bespoke-silicon-group / bsg_sv2v Goto Github PK
View Code? Open in Web Editor NEWA tool that converts SystemVerilog to Verilog. Uses Design Compiler, so it is 100% compatible.
License: BSD 3-Clause "New" or "Revised" License
A tool that converts SystemVerilog to Verilog. Uses Design Compiler, so it is 100% compatible.
License: BSD 3-Clause "New" or "Revised" License
Seems like this would be a great (optional, add-on) feature to make sure that we are generating correct code.
On certain designs, yosys errors out with the following
Note: Assuming pure combinatorial block at ./designs/src/swerv/swerv_wrapper.sv2v.v:75 in
compliance with IEC 62142(E):2005 / IEEE Std. 1364.1(E):2002. Recommending
use of @* instead of @(...) for better match of synthesis and simulation.
./designs/src/swerv/swerv_wrapper.sv2v.v:75: ERROR: Found non-synthesizable event list!
This seems to be related to the sensitivity list of the always@ block
always @(posedge clk or N0) begin
if(N0) begin
dout[0] <= 1'b0;
end else if(1'b1) begin
dout[0] <= din[0];
end
end
I am not sure if this is an issue with the original verilog file, however synthesis works in DC.
I have observed this issue on another design that passed with always_at_redux_opt performed.
bsg_sv2v/scripts/py/bsg_elab_to_rtl.py
Line 87 in 04743a4
Extremely long lines in generated verilog can cause yosys to crash.
1. Executing Verilog-2005 frontend: ./designs/src/ariane/ariane.sv2v.v
Parsing Verilog input from `./designs/src/ariane/ariane.sv2v.v' to AST representation.
input buffer overflow, can't enlarge buffer because scanner uses REJECT
See attached files from sv2v. Simply breaking up the super long lines resolved ths.
Co-allating the original verilog files can be a bit challenging so hoping the elab.v works as a starting point
ariane.tar.gz
The always@ reduction fails in swerv design with the following error
INFO: Performing wire/reg declartion optimizations.
INFO: Performing always@ reduction optimizations.
Traceback (most recent call last):
File "/net/trenton/x/ajayi/projects/OpenROAD/alpha-release/bsg_sv2v/scripts/py/bsg_elab_to_rtl.py", line 103, in <module>
ast_always_at_redux_opt_inplace( ast )
File "/net/trenton/x/ajayi/projects/OpenROAD/alpha-release/bsg_sv2v/scripts/py/bsg_ast_always_at_redux_opt_inplace.py", line 82, in ast_always_at_redux_opt_inplace
ast_always_at_redux_opt_inplace(c)
File "/net/trenton/x/ajayi/projects/OpenROAD/alpha-release/bsg_sv2v/scripts/py/bsg_ast_always_at_redux_opt_inplace.py", line 82, in ast_always_at_redux_opt_inplace
ast_always_at_redux_opt_inplace(c)
File "/net/trenton/x/ajayi/projects/OpenROAD/alpha-release/bsg_sv2v/scripts/py/bsg_ast_always_at_redux_opt_inplace.py", line 53, in ast_always_at_redux_opt_inplace
if a.sens_list == always_blocks[bot_index].sens_list:
File "/afs/eecs.umich.edu/cadre/software/anaconda3-2018.12/lib/python3.7/site-packages/pyverilog-1.1.3-py3.7.egg/pyverilog/vparser/ast.py", line 46, in __eq__
if c != other_children[i]: return False
IndexError: tuple index out of range
Applying -no_always_at_redux_opt makes it generate.
When there is a parsing error, e.g.,
*** Presto compilation terminated with 1 errors. ***
the tool does not stop immediately, but runs everything else, so you are forced to scroll back and try to hunt for the error in the output.
After some digging, I think I found the issue why module top is not appearing. Take "bsg_cache.v" for example
Temporary solution that worked for me so far:
in bsg_sv2v/scripts/py/run_dc.tcl, I replaced the Rename portion of the code with the following code (taken from the bsg_target_design.dc.read_design.tcl from bsg_ppa_regression):
### Rename and set the real top-level design
# Check if the design name is found in the collection of designs. If not, then
# it either doesn't exist or it has been renamed (from parameters)
if { [sizeof_collection [get_designs -quiet ${DESIGN_NAME}]] == 0 } {
set designs [get_designs -quiet -filter "@hdl_template == ${DESIGN_NAME}"]
if { [sizeof_collection $designs] > 1 } {
puts "BSG-Error: Toplevel design has multiple instances post-elaboration. This"
puts "usually indicates that there are multiple parameterizations of the design."
puts "This flow does not support different parameterizations of the top-level"
puts "compile target, consider using a wrapper to uniqify the hierarchy for each"
puts "parameter."
exit -1
}
rename_design ${designs} ${DESIGN_NAME}
}
See "undefined" in example directory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.