[myhdl-list] use constants as signals
Brought to you by:
jandecaluwe
From: Katrin W. <kat...@s2...> - 2010-03-30 13:13:32
|
Hello, I need to declare a signal with a constant value at the beginning of my program. This signal is needed in an always_comb decorator in another function, where it is changed. There is a problem with the conversion to VHDL, because in VHDL you can not declare a signal with a constant value at the beginning of a program. So I've tried to assign the value to the signal in a always_comb decorator, but the input signal doesn't change and the always_comb decorator is not called. There is also a problem, if I declare an intbv variable of this constant value, because the always_comb decorator can not change intbv variables. Does anybody know a solution to my problem? I've attached two examples of my problem. best regards Katrin ##################################### def foo1(): a = Signal(intbv(12)[8:]) @always_comb def bar(): a.next = 12 # not working because sensitivity list is empty def foo2(): a = intbv(12)[8:] @always_comb def bar(): b.next = a >> 1 # always_comb cannot handle intbv constants |