mkreider / wbgenplus

wbgenplus - A WishBone3 bus device generator for Vhdl in python
4 stars 1 forks source link

Generating negative upper bounds for ranges #2

Open skorsky opened 4 years ago

skorsky commented 4 years ago

For the input

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wbdevice author="M. Skorsky" version="0.0.1" email="m.skorsky@gsi.de">

  <clockdomain name="sys"></clockdomain>

  <slaveinterface name="wb_counter" data="32" type="pipelined" pages="0">         
    <sdb vendorID="GSI" productID="0x78812200" version="1" date="auto" name="Counter in a slave"></sdb>
    <registers>
      <reg name="counter0" read="yes" comment="Data Counter 0"></reg>
    </registers>
  </slaveinterface>

</wbdevice>

I get

  sp : wb_skidpad
  generic map(
    g_adrbits   => -2
  )

in WB_Counter_auto.vhd

skorsky commented 4 years ago

Workaround: Use at least 3 registers. With 1 register you get:

Slave <wb_counter>: Found 4 register names, last Adr is 00000000, Adr Range is 00000000, = -2 downto 2

With 2 registers you get

Slave <wb_counter>: Found 5 register names, last Adr is 00000004, Adr Range is 00000003, = 1 downto 2