YosysHQ / arachne-pnr

Place and route tool for FPGAs
MIT License
413 stars 72 forks source link

"Assertion failed!" when instantiating pullup manually #76

Closed cr1901 closed 6 years ago

cr1901 commented 6 years ago

I have created a MVCE of a single SB_IO primitive being instantiated to enable the I/O pullup, and the input being fed to an output pin. Running build_top.bat produces the following crash on Windows. I am currently unable to test on Linux:

seed: 1
device: 1k
read_chipdb +/chipdb-1k.bin...
  supported packages: cb121, cb132, cb81, cm121, cm36, cm49, cm81, qn84, swg16tr, tq144, vq100
read_blif top.blif...
prune...
read_pcf top.pcf...
instantiate_io...
pack...

After packing:
IOs          3 / 96
GBs          0 / 8
  GB_IOs     0 / 8
LCs          0 / 1280
  DFF        0
  CARRY      0
  CARRY, DFF 0
  DFF PASS   0
  CARRY PASS 0
BRAMs        0 / 16
WARMBOOTs    0 / 1
PLLs         0 / 1

place_constraints...
promote_globals...
  promoted 0 nets
  0 globals
realize_constants...
place...
  initial wire length = 40
  at iteration #50: temp = 7.92282, wire length = 40
  final wire length = 40

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Assertion failed!

Program: C:\msys64\mingw32\bin\arachne-pnr.exe
File: src/bitvector.hh, Line 91

Expression: i >= B && i < n + B

I do not know for sure whether:

  1. arachne-pnr is being fed bad output from yosys.
  2. The yosys output is fine, but arachne-pnr chokes.

Regardless, I wouldn't have expected a crash; the code from which this sample was derived was known to work in September 2016. I recently upgraded yosys from a September 2016 version when I was still using a June 2016 version of arachne-pnr; both the June 2016 and current HEAD crash with this output from my current build. So, I expect that some field in the yosys-emitted BLIF changed between 2016 and now, and arachne-pnr chokes.

Here is some relevant version information:

$ arachne-pnr --version
arachne-pnr 0.1+203+1 (git sha1 7e135ed, g++ 5.3.0 -O2)

$ yosys -V
Yosys 0.7+307 (git sha1 56565a4, i686-w64-mingw32-gcc 5.3.0 -Os)

$ uname -a
MINGW32_NT-6.1 William-THINK 2.4.0(0.292/5/3) 2015-12-22 09:37 x86_64 Msys

Note the yosys used is a fork.

cr1901 commented 6 years ago

Closing as not a bug: https://gist.github.com/cr1901/2a2a3ef162b2a83238a19b9e0dc832e6#file-top-v-L9

Setting .PIN_TYPE to 6'd0 solves the bit-width mismatch between arachne-pnr and my code.

cliffordwolf commented 6 years ago

I should trigger an error message, not an assertion. I think that makes it a bug.