Modify VHDL generic value with ghdl in cocotb

Viewed 520

I managed to read generic module value with cocotb without problem. But if I can't manage to write it.

My VHDL generic is :

...
generic (
    ... 
    C_M00_AXI_BURST_LEN : integer   := 16;
    ...
)

I can read it in cocotb:

 self.dut.log.info("C_M00_AXI_BURST_LEN 0x{:x}".format(
                   int(self.dut.c_m00_axi_burst_len)))

But if I try to change it :

self.dut.c_m00_axi_burst_len = 32

I get this python error :

  Send raised exception: Not permissible to set values on object c_m00_axi_burst_len
File "/opt/cocotb/cocotb/decorators.py", line 197, in send
  return self._coro.send(value)
File "/usr/local/projects/axi_pattern_tester/vivado_ip/axi_pattern_tester_1.0/cocotb/test_axi_pattern_tester_v1_0.py", line 165, in axi4_master_test
  dutest.print_master_generics()
File "/usr/local/projects/axi_pattern_tester/vivado_ip/axi_pattern_tester_1.0/cocotb/test_axi_pattern_tester_v1_0.py", line 86, in print_master_generics
  self.dut.c_m00_axi_burst_len = 32
File "/opt/cocotb/cocotb/handle.py", line 239, in __setattr__
  return getattr(self, name)._setcachedvalue(value)
File "/opt/cocotb/cocotb/handle.py", line 378, in _setcachedvalue
  raise TypeError("Not permissible to set values on object %s" % (self._name))

Is there a way to do it using GHDL as simulator ?

1 Answers
Related