lecture_slides_week13
lecture_slides_week13
Design CE 325 L1
SPRING 2024
Instructor : Dr. Syed Arsalan Jawed
Associate Professor of Practice
[email protected]
Room : W-301
Office Hours : Monday 0930-1030, Wednesday 1430-1530, Friday 0930-1030
Installing and Using Open Source Synthesis
Tool Yosys
• Download OSS_CAD***.EXE for Windows 11 from the following link
• https://yosyshq.net/yosys/download.html
• Open CMD as Admin. Go to the folder where .exe was placed. Go inside OSS_CAD folder.
• Optimizations
• Coarse Levels : at adders/multipliers level
• Fine Levels : at single bit gates level
• Technology Mapping
• Converting the design into a netlist of cells available in the target architecture
• FPGA : CLBs, LUT cells, special function units
• ASIC : process specific cell lib provided by fab
Typical Synthesis Flow in Yosys – section 3.3 from
Yosys Manual Pdf
#1 read input file to internal representation
read_verilog design.v
#2 convert high-level behavioral parts ("processes") to d-type flip-flops and muxes 5
proc
#3 perform some simple optimizations
Opt
#4 convert high-level memory constructs to d-type flip-flops and multiplexers
Memory
#5 perform some simple optimizations
Opt
#6 convert design to (logical) gate-level netlists
Techmap
#7 perform some simple optimizations
Opt
#8 map internal register types to the ones from the cell library
dfflibmap -liberty cells.lib
#9 use ABC to map remaining logic to cells from the cell library
abc -liberty cells.lib
#10 cleanup
opt
#11 write results to output file
Implementation Overview
Design data is read in using one of the frontend
modules.
• Launch:
• Yosys demo.sv <enter>
• This will open a new terminal and would read in the Verilog of demo.sv which
has a simple 6-bit counter
• Execute:
• Using a command prompt, go to the folder demo.dot was generated, run the following
command to generate an graphical SVG file:
• Dot –Tsvg demo.dot > demo.svg
• Open the demo.svg file in Web browser. This will show complete graphical dataflow of your
logic.
• Read Fifo (follow the complete example from repo link above)
• Read_Verilog fif.sv
• hierarchy -check -top fifo
• Proc
The highlighted fifo_reader block contains two instances of the addr_gen module, fifo_reader and
fifo_writer. Notice how the type is shown as $paramod\\addr_gen\\MAX_DATA=s32'.... This is a
“parametric module”: an instance of the addr_gen module with the MAX_DATA parameter set to the
given value.
The other highlighted block is a $memrd cell. At this stage of synthesis we don’t yet know what type
of memory is going to be implemented, but we do know that rdata <= data[raddr]; could be
implemented as a read from memory.
Also see that en and clock of $memrd are 1’bx so its not getting implemented as a memory block.
• flatten
• Observe the svg again and comment on the difference before flatten
command.
SS : The online example claims the above, carefully traverse through your SVG to observe if
that has actually happened.
Further Optimizations
• Wreduce
• wreduce - reduce the word size of operations if possible. If we
run this we get the following: