Comments (3)
You can work around that problem by making sure the parameter is defined before it is being used. You can do that by either going all-in with the Verilog-2001 syntax for port and parameter declarations:
module test2 #(
parameter WIDTH = 16 * 2
) (
output [WIDTH-1:0] out
);
endmodule
Or by falling back to the Verilog-95 syntax:
module test3 (out);
parameter WIDTH = 16 * 2;
output [WIDTH-1:0] out;
endmodule
I'll see if I can fix this and post another comment then.
Would you consider fixing this bug
I would not call it a bug. E.g. modelsim also refuses to process your code:
-- Compiling module multiply
** Error: test2.v(5): (vlog-2730) Undefined variable: 'A_WIDTH'.
** Error: test2.v(5): 'a' already declared in this scope (multiply).
** Error: test2.v(6): (vlog-2730) Undefined variable: 'B_WIDTH'.
** Error: test2.v(6): 'b' already declared in this scope (multiply).
** Error: test2.v(7): (vlog-2730) Undefined variable: 'OUT_WIDTH'.
** Error: test2.v(8): 'out' already declared in this scope (multiply).
....
And modelsim is even pickier: It doesn't matter if the parameter points to an expression or a literal. The only difference is that modelsim creates better error messages.
from yosys.
Fixed in commit 422794c.
from yosys.
Thanks for the quick reply and fix! That's really helpful!
from yosys.
Related Issues (20)
- CXXRTL: >20x compile time regression with clang++-18 HOT 3
- Wrongly assign the name internal signal for vhdl HOT 1
- The $check cell could not support TRG_WIDTH > 1 lead to old design verification failed with `async2sync` command. HOT 2
- formal: Produced traces make it look like asserts trigger a clock step too late HOT 7
- Yosys Verilog Parsing Error: Unable to Synthesize After Reading File HOT 2
- cell reference names appear to be truncated
- Ensuring smooth Yosys-to-Synlig compatability and tracking HOT 13
- Clean up uses of #if(n)def EMSCRIPTEN
- Throws a segmentation fault if the 'input.blif' file's size is huge. HOT 2
- Stub RTL Generation Feature
- Performance Issue: Synthesis Takes Too Long to Complete HOT 9
- system verilog "import" command not recognized (ERROR: syntax error, unexpected TOK_ID) HOT 3
- check-git-abc in Makefile for the first compile time HOT 4
- `count_id(cell->name) == 0` failure HOT 1
- IDES4_MEM gowin module is missing HOT 2
- Feature Request: Add Support for Input Filelist Option HOT 8
- CologneChip synthesis fails silently (simulation discrepancies) HOT 2
- Yosys Synthesis Error: Hash Table Exceeded Maximum Size HOT 8
- support error for Aggregate Initialization and Replication HOT 1
- Unable to code FSM into binary format HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yosys.