Comments (5)
The problem is an inferred latch in your ram_test.v, because the decoder doesn't cover all possibilities. Without totally rewriting the decoder, the simplest fix I see is to add an "else" clause as follows (choose your own default value) :
always @*
begin
casez ({c12, c11}) // Depending on memory address, select different RAM blocks.
2'b00: insn = insn0;
2'b01: insn = insn1;
2'b10: insn = insn2;
2'b11: begin
if (!c10 & !c9 & !c8) insn = insn3; // Select the 256x16 blocks
else if (!c10 & !c9 & c8) insn = insn4;
else if (!c10 & c9 & !c8) insn = insn5;
else if (!c10 & c9 & c8) insn = insn6;
else if ( c10 & !c9 & !c8) insn = insn7;
else if ( c10 & !c9 & c8) insn = insn8;
else insn = 16'h0000;
end
endcase
With the fix you get a timing estimate of 37.25MHz.
from icestorm.
I will keep the issue open however, as a reminder to myself to add a nicer error message in icetime in this situation.
from icestorm.
the simplest fix I see is to add an "else" clause as follows (choose your own default value)
I'd personally prefer a default assignment in the beginning of the block. something like this:
always @*
begin
insn = 16'bx;
casez ({c12, c11}) // Depending on memory address, select different RAM blocks.
2'b00: insn = insn0;
2'b01: insn = insn1;
2'b10: insn = insn2;
2'b11: begin
if (!c10 & !c9 & !c8) insn = insn3; // Select the 256x16 blocks
else if (!c10 & !c9 & c8) insn = insn4;
else if (!c10 & c9 & !c8) insn = insn5;
else if (!c10 & c9 & c8) insn = insn6;
else if ( c10 & !c9 & !c8) insn = insn7;
else if ( c10 & !c9 & c8) insn = insn8;
end
endcase
end
from icestorm.
OMG, a freshman's mistake :) Thanks!
The timing estimates from 32-40MHz based on the seed..
from icestorm.
I get a similar report from icetime (with loop-start, the time starting from ~1000000 ns, etc.) with the following Verilog module:
module repro(clk, out);
input clk;
output out;
reg [8:0] data;
always @(posedge clk) begin
if (data == 9'd 10)
data <= 9'b 0;
else
data <= data + 1;
end
assign out = data < 9'd 8;
endmodule
Changing the register width from [8:0]
to [7:0]
makes the icetime report look normal (Edit: at least when using synth_ice40 -abc9
...?). The issue seems to originate from the data < 9'd 8
comparison. I don't see any reports in the Yosys log of any inferred latches or any other abnormalities.
Putting aside the question of whether this is good Verilog, I'd really like to figure out why the icetime report looks the way it does.
Yosys/Nextpnr/icetime output: yosys-nextpnr-icetime.log
from icestorm.
Related Issues (20)
- `icepack` crashes generating netpbm image on Windows HOT 1
- g++-8.3.0 coredumps when building icestorm HOT 8
- Return code 1 when using the help flag HOT 1
- make install fails with BSD sed on macOS HOT 4
- Error: Got .io_tile statement for logic tile HOT 5
- icebox Makefile make[1]: *** [install] Error 1 HOT 1
- enhancement request: Support the NVCM HOT 4
- Targetting 8k-tq144:4k but missing pins 65 and 66 which are bound to ICE_CDONE and ICE_CREST. HOT 2
- Not able to use both PLLs of iCE40-HX4K HOT 5
- enhancement request: Add git tags
- iceprog takes 165secs to program 111kB into UPduino with FT232H HOT 3
- RS-232 on ice40 UP5k
- Broken website URL HOT 1
- UP5K: embedded block RAM clock edge/polarity
- Errors when running post-synthesis simulation examples HOT 3
- Wrong spelling of 'documentation' in the GitHub description
- Installation on Ubuntu 22.04.1
- Add support for iCE65 devices? HOT 6
- icebram incompatible with new memory_libmap HOT 13
- 'initial begin' bit order vs assigning value on clock cycle 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 icestorm.