Comments (4)
AFAIK, zero sized ports are not legal verilog or systemverilog code.
The typical [WIDTH-1:0] construct yields an error when WIDTH==0 on any tool I'm aware of.
from yosys.
AFAIK, zero sized ports are not legal verilog or systemverilog code. The typical [WIDTH-1:0] construct yields an error when WIDTH==0 on any tool I'm aware of.
Now that I think of it, strictly speaking shouldn't the Verilog construct be interpreted to declare a two-bit vector with reversed indexing when WIDTH=0
? I think that's how Yosys does interpret it, but if I have a CXXRTL blackbox with explicit (* cxxrtl_width = "WIDTH" *)
annotation on the port, then CXXRTL unsurprisingly takes the WIDTH=0
case to imply a zero-sized port. That's the behavior I want but if this wouldn't work outside of CXXRTL the same way then I guess the value in supporting this is dubious. That is, there's no companion synthesis flow where I would supply a Verilog implementation of what's otherwise the CXXRTL-blackboxed module, and the specialization would match what happens on the CXXRTL side.
I will close this for the time being.
from yosys.
Now that I think of it, strictly speaking shouldn't the Verilog construct be interpreted to declare a two-bit vector with reversed indexing when WIDTH=0?
It seems you were right!
Consider the following test:
module x (
input [6:5]w1,
input [5:6]w2,
input [-5:-6]w3,
input [-6:-5]w4,
input [0:-1]w5,
input [-1:0]w6
);
generate
$info("w1=%1d w2=%1d w3=%1d w4=%1d w5=%1d w6=%1d", $bits(w1), $bits(w2), $bits(w3), $bits(w4), $bits(w5), $bits(w6));
endgenerate
endmodule
I've tested 4 tools:
slang, Verilator and 2 commercial tools, and they all produce w1=2 w2=2 w3=2 w4=2 w5=2 w6=2
.
from yosys.
but if I have a CXXRTL blackbox with explicit
(* cxxrtl_width = "WIDTH" *)
annotation on the port, then CXXRTL unsurprisingly takes theWIDTH=0
case to imply a zero-sized port.
We can special-case that to just remove the port entirely, maybe?
from yosys.
Related Issues (20)
- Error Arises During Synthesis due to Verilog Code Structure HOT 3
- Use /usr/bin/env for bash on remaining places
- synth_nexus with -abc9: CCU2 cells get the low order CIN connected to constant 1'b0 HOT 2
- crash in select and delete HOT 1
- `sim` doesn't consider assertions failed if EN=x A=0 HOT 1
- Can't call DPI function with no return (void return type) HOT 2
- Gowin BSRAM inference -- We need B suffix (such as DPB instead of current DP) HOT 52
- Segmentation fault with verific HOT 2
- Defect in btor2 file format generation
- ERROR: Unsupported internal cell `$pow' HOT 3
- Bug with modulo in CXXRTL when operands intersect HOT 5
- Bug: Logic and arithmetic left shifts sometimes overflow the output signal HOT 8
- Bug: incorrect division in CXXRTL HOT 4
- Bug: Shifts (in both directions) consider the operand signed under some conditions in CXXRTL
- Bug: Segmentation fault during step for CXXRTL HOT 6
- `read_blif; write_blif; read_blif;` doesn't work HOT 3
- Performance issue with many concatenations in CXXRTL HOT 2
- Add a generic way to delete all non-synthesizable cells HOT 2
- Share pass uses too much system memory for large combinatorial networks HOT 2
- Tech lib DSP_A/B_MINWIDTH value change causes ABC9 error
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.