Re: Anonymous Struct Members / Struct Constants



On Jun 20, 12:55 am, krustev.svi...@xxxxxxxxxxxxxx wrote:
Maybe something like this

...
wire [7:0] mask = 8'h01 << bitposition;
SFR0 |= mask; // to set a bit
SFR0 &= ~mask; // to clearit
...

bitposition could be defined in an enum which will improve your
readability.

I presume you're talking about 8 bit core with a dedicated operation
to clear/set bits in the I/O space. Because normally this is done on 3
steps read/modify/write and involves the entire register anyway, so
all the above remains simply an excercise.

Have you tried using classes .There you can have defualt members, You
can write classes in DUT by using the flags -ntb_opts dtm , I am
talking of VCS though

.



Relevant Pages

  • Re: Anonymous Struct Members / Struct Constants
    ... bitposition could be defined in an enum which will improve your ... readability. ... I presume you're talking about 8 bit core with a dedicated operation ...
    (comp.lang.verilog)
  • Re: something like switch in c
    ... I have to insert the name in the enum list as well. ... use a switch with the enum values. ... Readability, ... darrell at cs dot toronto dot edu ...
    (comp.programming)
  • Re: String or Numeric Variable?
    ... it appears that using numeric constants will solve the 'readability' ... >>issue and Enum perhaps more efficient? ... > Const Afternoon As Long = 2 ... > Dim TimeOfDay as TOD ...
    (comp.lang.basic.visual.misc)
  • Re: String or Numeric Variable?
    ... it appears that using numeric constants will solve the 'readability' ... >issue and Enum perhaps more efficient? ... Const Afternoon As Long = 2 ... Dim TimeOfDay as TOD ...
    (comp.lang.basic.visual.misc)
  • [9fans] Alef - run time error
    ... The runtime fails: ... so I presume that new values and hopefully not major surgery, ...
    (comp.os.plan9)