Re: [myhdl-list] Object type is not supported in this context
Brought to you by:
jandecaluwe
From: Jan C. <jan...@mu...> - 2012-05-12 16:23:07
|
On 12/05/12 14:03, Jan Coombs wrote: > This error message points to a blank line, which is always > immediately before the start of a code block: The complex error messages were caused by confusion about intbv indexing, using: memRdNetSlice.next = memRdSlice(NSW,0) instead of: memRdNetSlice.next = memRdSlice[NSW:0] As the code now converts to Verilog, although not VHDL, I tried to restore the enum code, just in case, but this still fails, likely in the block shown below: > ExST = enum('Fetch1','Fetch2','NewAddr','Skip', \ > 'Gap','Broken', encoding='one_hot') > > > The next block of code would be difficult without the enum, but > this seems to be where the problem is: > > @always_comb > def execNextStateLogic_AsyncNoVar(): > ''' determine what next execution state will be ''' > ''' line 159: Object type is not supported in this context: > ExST ''' > if reset: execNextState.next = ExST.Skip > else: > if (execState==ExST.Fetch1): > if (memRdSlice==ToMem)| \ > (memRdSlice==Alu2op)| \ > (memRdSlice==Alu1op)| \ > (memRdSlice==FromMem): \ > execNextState.next = ExST.Fetch2 > elif (memRdSlice==Branch): \ > execNextState.next = ExST.NewAddr > elif (memRdSlice==Skip)| \ > (memRdSlice==Lit)| \ > (memRdSlice==Call): \ > execNextState.next = ExST.Skip > else: execNextState.next = ExST.Gap > elif execState==ExST.Fetch2: \ > execNextState.next = ExST.Gap > elif execState==ExST.NewAddr: > if (memRdMore==0): \ > execNextState.next = ExST.Gap > else: execNextState.next = ExST.NewAddr > elif execState==ExST.Skip: > if (memRdMore==0): \ > execNextState.next = ExST.Gap > elif execState==ExST.Gap: \ > execNextState.next = ExST.Fetch1 > elif execState==ExST.Broken: \ > execNextState.next = ExST.Broken > else: execNextState.next = ExST.Broken > > > Now I have converted the code using enum to use constants, and > don't get the improper use of ExST error. Now I can get on, wrap my code in a test harness, and try it with the on-chip RAM block. Jan Coombs. |