GHDL Tutorial From with-ghdl/ with-ghdl/

Slides:



Advertisements
Similar presentations
VHDL in digital circuit synthesis (tutorial) dr inż. Miron Kłosowski EA 309
Advertisements

Introduction To VHDL for Combinational Logic
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
Arbitrary Waveform Discussion 5.5 Example 34.
Edge-Triggered D Flip-Flops Discussion D4.2 Example 26.
Multiplexer as a Universal Element Discussion D2.6 Example 9.
7-Segment Display: Spartan-3 board
Shifters Discussion D7.1 Example Bit Shifter.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Adder Discussion D6.2 Example 17. s i = c i ^ (a i ^ b i ) c i+1 = a i * b i + c i * (a i ^ b i ) Full Adder (Appendix I)
Top-level VHDL Designs
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
2-to-1 Multiplexer: if Statement Discussion D2.1 Example 4.
Decoders and Encoders Lecture L4.2. Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
Lab Lecture 3 VHDL Architecture styles and Test Bench -Aahlad.
Digilent Spartan 3 Board Lecture L2.2
Structural VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T3: ALU Design.
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
Lab 2 4-Bit Adder Digilent Spartan 3 Board Lecture L2.3.
4-to-1 Multiplexer: case Statement Discussion D2.3 Example 6.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #12) The slides included herein were taken from the materials.
4-Bit Binary-to-BCD Converter: case Statement
1 Comparators: Procedures Discussion D9.2 Example 22.
Random-Access Memory Distributed and Block RAM Discussion D10.3 Example 41.
AND Gate: A Logic circuit whose output is logic ‘1’ if and only if all of its inputs are logic ‘1’.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
1 Part I: SYSTEM DESIGN. 2 Packages and Components Functions and Procedures Problem (Design & Implementation) Additional System Designs.
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE Simulator 1: Synopsys Simulator Instructor: Francis G. Wolff Case Western.
Basic Overview of VHDL Matthew Murach Slides Available at:
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
EE3A1 Computer Hardware and Digital Design Lecture 5 Testbenches and Memories in VHDL.
Digital Systems Design VHDL simulation of a 3 – Bit Binary Decoder with Enable by Marc A. Mackey.
Introduction to VLSI Design – Lec01. Chapter 1 Introduction to VLSI Systems Lecture # 6 Computer-Aided Design Technology for VLSI.
CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis Aleksandar Milenkovic
Design Examples ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #11) The slides included herein were taken from the materials.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
George Mason University Simple Testbenches ECE 545 Lecture 4.
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
VHDL for Finite State Machines. Sorry – no standard way One way –Use TYPE and SIGNAL ARCHITECTURE Behavior OF two_ones_fsm IS TYPE State_type IS ( A,
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Digital System Projects
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE Simulator 2: Textio, Wait, Clocks, and Test Benches Instructor: Francis G. Wolff
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
1 Computer Architecture & Assembly Language Spring 2009 Dr. Richard Spillman Lecture 11 – ALU Design.
Combinational logic circuit
Introduction to Vivado
LAB #4 Xilinix ISE Foundation Tools VHDL Design Entry “A Tutorial”
Describing Combinational Logic Using Processes
Combinational Circuits Using VHDL
ECE 4110–5110 Digital System Design
LIBRARY IEEE; Include Libraries for standard logic data types USE IEEE.STD_LOGIC_1164.ALL; -- Entity name normally the same as file name.
LIBRARY IEEE; Include Libraries for standard logic data types USE IEEE.STD_LOGIC_1164.ALL; -- Entity name normally the same as file name.
Getting Started with Vivado
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Sequntial-Circuit Building Blocks
ECE 545 Lecture 5 Simple Testbenches.
4-Input Gates VHDL for Loops
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
(Simple Testbenches & Arithmetic Operations)
Presentation transcript:

GHDL Tutorial From with-ghdl/ with-ghdl/

Makefile # vhdl files FILES = src/* VHDLEX =.vhd # testbench TESTBENCHPATH = testbench/${TESTBENCH}$(VHDLEX) #GHDL CONFIG GHDL_CMD = ghdl GHDL_FLAGS = --ieee=synopsys --warn-no-vital-generic SIMDIR = simulation # Simulation break condition #GHDL_SIM_OPT = --assert-level=error GHDL_SIM_OPT = --stop-time=500ns WAVEFORM_VIEWER = gtkwave all: compile run view new : echo "Setting up project ${PROJECT}" mkdir src testbench simulation compile : ifeq ($(strip "TESTBENCH not set. Use TESTBENCH=value to set 2 endif mkdir -p simulation $(GHDL_CMD) -i $(GHDL_FLAGS) --workdir=simulation --work=work $(TESTBENCHPATH) $(FILES) $(GHDL_CMD) -m $(GHDL_FLAGS) --workdir=simulation --work=work $(TESTBENCH) simulation/$(TESTBENCH) run $(GHDL_SIM_OPT) --vcdgz=$(SIMDIR)/$(TESTBENCH).vcdgz view : gunzip --stdout $(SIMDIR)/$(TESTBENCH).vcdgz | $(WAVEFORM_VIEWER) --vcd clean : $(GHDL_CMD) --clean --workdir=simulation

Source: src/and_2.vhd library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity and_2 is port ( a, b : in std_logic; c : out std_logic ); end entity; architecture behav of and_2 is begin c <= a and b; end behav;

Testbench: testbench/and_2_tb.vhd library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity and_2_tb is end entity; architecture TB of and_2_tb is component and_2 port( a, b: in std_logic; c : out std_logic); end component; signal sa, sb, sc: std_logic; begin a : and_2 port map(a => sa, b => sb, c => sc); sa <= '0' after 0 ns, '1' after 30 ns, '0' after 60 ns, '1' after 90 ns; sb <= '0' after 0 ns, '1' after 15 ns, '0' after 30 ns, '1' after 45 ns, '0' after 60 ns, '1' after 75 ns, '0' after 90 ns; end TB;

Usage make TESTBENCH=and_2_tb