This repository contains the examples for the short course: SystemVerilog for ASIC/FPGA Design & Simulation. The 64-hour hands-on course was delivered collaborating with Synopsys, teaching 271 participants from 13 countries, through basic (full adder, counter) to advanced (Parameterized AXI-Stream Matrix Multiplier with UART I/O) examples, testing each with randomized transactional testbenches, implementing the final system on FPGA & testing with Python, and taking it through the ASIC flow with Synopsys tools.
Course was well organized in a way for both beginners & intermediate students. Practical problems & projects oriented teaching style is really made easier to learn and grasp fundamentals & more. Thank you very much for the well confident lecture panel & organizers.
This course is a good start for my long journey. Absolutely good. Lectures were good. Hope more things from ENTC, Synopsys and Skill Surf. Good Luck.
The things I learned from this course - the insights, tactics, and guidance - felt more valuable than everything else I gained from this course. Never been to a course like this well prepared ... hats-off to the entire team .. And their effort should be high appreciated ...These kind of initiatives deserves to reach much more audience .. Wishing the team the best in their future endeavors ..
Actually the instructors were very knowledgeable on this area and gave not only the theoretical knowledge but always gave an industrial approach. Giving access to the session recordings and other lecture materials though the moodle is also very convenient for us and it is highly appreciated.I am very grateful to have this course well with a discount also, as this knowledge is very difficult to occupy from a country like ours where there are not much resource persons in this domain.The content is okay but the sessions were much lengthy.So in next iteration of the course if the number of session hours within a day can be reduced it will be more convenient for the participants.
Dr./Mr. Abarajithan was well-prepared for the lectures and explained System Verilog programming very clearly, while also highlighting the opportunities in this field. The course content covered the basics of FPGA programming, which is helpful for beginners who are taking their baby steps in this field. As a beginner, I am satisfied with following this course.
The course was very interesting, and I was a total beginner for the SystemVerilog. But, at the end with the help of the teachers and the instructors I was able to grab the content in my best. I am willing to join future courses and waiting for them. Thank you very much.
The examples given in this repo have been tested on Xilinx Vivado and Synopsys DesignCompiler. Full system, AXI Stream system and their submodules have been tested on Icarus Verilog as well.
mvm_uart_system.v
: Full system, implemented on FPGA, and as an ASIC, with UART serial (rx, tx) I/Ouart_rx.sv
: Receives the matrixk[R,C]
and input vectorx[C]
as UART serial input and converts to parallel AXI Streamaxis_matvec_mul.v
: Wrapper to make the simple latency-based matvec_mul into AXI Stream modulematvec_mul.sv
: Multipliesk[R,C]
andx[C]
to producey[R]
in clog2(C) clock cyclesskid_buffer.sv
: Breaks the combinational path from m_ready to s_ready and "skids" the data into a buffer whenm_ready=0
uart_tx.sv
: Converts output vectory[R]
from parallel AXI Stream into serial UART output
To synthesize the full system with Synopsys DesignCompiler, first edit asic_flow/run_dc.tcl
and add the path to PDK next to target_library
mkdir asic_flow/syn
cd asic_flow/syn
dc_shell -f ../run_dc.tcl
mvm_uart_system_tb.sv
: Randomizek
&x
, drives TX & monitors RX in parallel, assertsy_exp==exp
mvm_uart_system.v
: Top module
To test the full system with Icarus Verilog:
iverilog -g2012 -o compiled rtl/mvm_uart_system.v rtl/uart_rx.sv rtl/uart_tx.sv rtl/axis_matvec_mul.v rtl/matvec_mul.sv rtl/skid_buffer.sv tb/mvm_uart_system_tb.sv tb/simple_axis_tb.sv && vvp compiled
axis_matvec_mul.v
and submodules as described above
axis_matvec_mul_tb.sv
: Randomizek
&x
, drives slave & monitors master in parallel, assertsy_exp==exp
axis_matvec_mul.v
: Top module as described abovesimple_axis_tb.sv
AXIS_Source
: parametrized module with taskaxis_push
to send a packet withN_BEATS
on a bus withW_BUS
width, while randomly togglings_valid
with given probabilityAXIS_Sink
: parametrized module with taskaxis_pull
to receive a packet withN_BEATS
from a bus withW_BUS
width, while randomly togglingm_ready
with given probability
To test the AXI Stream IP with Icarus Verilog:
iverilog -g2012 -o compiled rtl/axis_matvec_mul.v rtl/matvec_mul.sv rtl/skid_buffer.sv tb/axis_matvec_mul_tb.sv tb/simple_axis_tb.sv && vvp compiled
Each example introduces digital design concepts and synthesisable (RTL) & non-synthesisable (verification) features of SystemVerilog.
full_adder
- Adds 2 bits and carry-in bit to produce 1 bit and carry-out bit
- RTL: 3 ways of combinational assignments, module, port, logical operators
- Verification: Initial block, dump waveform, delays, assertions, string formatting, read internal signals,
$display
n_bit_adder
- Chaining
full_adder
into a ripple carry adder - Design: Hierarchical design, parametrization
- RTL: Vectors, endian, packed/unpacked, parameters, module instantiation, synthesizable for loop
- Verification: Literals, randomizing with constraints (
std::randomize
), repeat loop
- Chaining
alu
- Combinational ALU
- RTL: signed type, if-else vs unique case
- Verification: Classes & objects, constructors, rand members, bit (2-state) vs logic (4-state)
function_lut
- Implementing functions and lookup tables
- RTL: static vs automatic, 2 ways to return, recursive functions, inverse functions, LUTs as arrays, synthesizing a function vs filling up a LUT.
decoder_example
- Writing a 435-line instruction decoder in 95-lines
- RTL: last assignment wins (remove duplicate lines), group common cases in
case
counter
- N-bit counter with increment signal
- Design: clock enable, synchronous active-high reset
- RTL: always_ff, non-blocking statements
- Verification: Clock generation
fir_filter
- Order N, (N+1 tap) fir_filter
- Design: Width of multipliers & adders, shift registers, asynchronous active-low reset
- RTL: array as parameter, Adding N numbers with
always_comb y += x
,$signed()
- Verification: File read & write, queues: (
push_front
,pop_back
)
fir_filter_2
:- Design: Retiming to increase frequency from 476 MHz to 1 GHz (2.1x)
p2s
- Parallel to Serial Converter with AXI Stream input (slave) and output (master ports)
- Design: State machines, AXI Stream protocol & signals, shift register
- RTL: 3-procedure coding style of state machines
uart_rx
,uart_tx
- Convert between UART & AXI Stream buses
- Design: UART protocol, Nested counters,
- RTL: 1-procedure coding style of state machines
- Verification: Randomizing with
$urandom
&$urandom_range
, driving & monitoring signals in parallel,wait
simple_axis_tb
- Randomized modules to verify AXI Stream functionality of other modules
- Verification:
AXIS_Source
- randomly toggles_valid
with given probability and send data. Scramble data ons_valid=0
AXIS_Sink
- randomly togglem_ready
with given probability and receive data
skid_buffer
- Design: skidding data when
m_ready=0
- Verification: Parallel AXI Stream driver & monitor
- Design: skidding data when
matvec_mul
- Design: parametrized adder trees
- RTL: packed multidimensional arrays
- Verification:
- Simple testbench:
foreach
loop,typedef
- Testbench with classes: virtual class to parametrize functions, streaming operator
- Simple testbench:
This project is licensed under the MIT License - see the LICENSE file for details
© SkillSurf 2023