[Libre-soc-dev] Confusing nmigen assert error

Cole Poirier colepoirier at gmail.com
Wed Sep 23 17:47:44 BST 2020


Hi Luke,

I'm working on icache.py and running into a TypeError in the icache_sim() test:

  File "icache.py", line 1629, in icache_sim
    assert i_in.valid
  File "/home/colepoirier/src/nmigen/nmigen/hdl/ast.py", line 152, in __bool__
    raise TypeError("Attempted to convert nMigen value to Python boolean")
TypeError: Attempted to convert nMigen value to Python boolean

I get the same error with the modifications:
"assert i_in.valid == 1" and
"assert i_in.valid == Const(1, 1)"

Any ideas what I'm doing wrong?

Cole



More information about the Libre-soc-dev mailing list