Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map::at: key not found #66

Open
C-Elegans opened this issue Jun 21, 2017 · 4 comments
Open

map::at: key not found #66

C-Elegans opened this issue Jun 21, 2017 · 4 comments

Comments

@C-Elegans
Copy link

When trying to route a design using LUT instantiation, I get this error:

route...
libc++abi.dylib: terminating with uncaught exception of type std::out_of_range: map::at:  key not found

Does arachne-pnr not support cascading LUTs via the LO port of ICESTORM_LC? I've tried it with both I0 and I2, and it errors both times.

Test case:

test.v:

module test (/*AUTOARG*/
   // Outputs
   LED,
   // Inputs
   clk, pin
   ) ;
   input clk, pin;
   output [1:0] LED;
   wire [1:0]  a;
   wire [1:0]  s;
   ICESTORM_LC #(
		 .LUT_INIT('b01),
		 .DFF_ENABLE(0))
   l1(
      .I0(pin), .LO(a[0]), .O(), .CLK(clk));
   ICESTORM_LC #(
		 .LUT_INIT('b01),
		 .DFF_ENABLE(1))
   l2(
      .I0(a[0]), .LO(a[1]), .O(s[0]), .CLK(clk));
    ICESTORM_LC #(
		 .LUT_INIT('b01),
		 .DFF_ENABLE(1))
   l3(
      .I0(a[1]), .LO( ), .O(s[1]), .CLK(clk));

   assign LED = s;
endmodule // test

test.pcf:

set_io LED[0] 99
set_io LED[1] 98
set_io pin 112
set_io clk 21

built with:

yosys -p "synth_ice40 -top test -blif test.blif" test.v
arachne-pnr -p test.pcf test.blif -o test.txt
@C-Elegans
Copy link
Author

With a similar but larger design, I have also gotten this error

route...
24506 -> 20635
Assertion failed: (unrouted.empty()), function route, file src/route.cc, line 749.

@mmicko
Copy link
Member

mmicko commented Nov 26, 2017

Adding next lines at line 161 of route.cc show the routing issue.

if (chipdb->tile_nets[t].find(tile_net_name) == chipdb->tile_nets[t].end())
{
fatal(fmt("failed to rote: " << p->name() << " to " << tile_net_name));
}

Thing is that lutff_7/lout does not exist in chipdb (it only exists for lutff_0 till lutff_6), and guess it that is how it is on real hardware as well, but would be good if @cliffordwolf can confirm that is valid.

@cliffordwolf
Copy link
Collaborator

Adding next lines at line 161 of route.cc show the routing issue.

Can you create a PR for this?

Thing is that lutff_7/lout does not exist in chipdb

Yes, this is correct afaik. The lout output of one lut can only be routed to in_2 of the next lut in the tile. For lutff_7 there is no next lut and therefore no lout signal. (When the FF is disabled then lout and out are the same. Otherwise lout is the signal before the FF.)

mmicko added a commit to mmicko/arachne-pnr that referenced this issue Nov 26, 2017
@mmicko
Copy link
Member

mmicko commented Nov 26, 2017

Sure, just made it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants