Zeev Gal
Zeev Gal

Reputation: 11

how to instance multple registers of the same type in specman

I have a register definition :

reg_def GCC_CTRL_12_T {
    reg_fld SEL_CH_PRIORITY : uint(bits:10) : RW : 0;
};

I created two registers of the same type:

extend  GCC_MAIN vr_ad_reg_file {
    reg_list HDLC_CORE1_GCC_CTRL_12[1] of GCC_CTRL_12_T at 0x1000b;
};
    
extend  GCC_MAIN vr_ad_reg_file {
    reg_list HDLC_CORE2_GCC_CTRL_12[1] of GCC_CTRL_12_T at 0x1010b;
};

in a sequence I created pointer to be used with write_reg:

extend CFG_CORE_REGS vr_ad_sequence {
    !core1_gcc12_ctrl : HDLC_CORE1_GCC_CTRL_12 vr_ad_reg;
    !core2_gcc12_ctrl : HDLC_CORE2_GCC_CTRL_12 vr_ad_reg;
};

but then I got an error :

Error:

'HDLC_CORE1_GCC_CTRL_12' is not a subtype of 'vr_ad_reg' at line 76 in /auto/ns_asics/VR_Projects/zgal/wa/alon/gcc/views/gcc_verif/gcc_verif/src/agents/mpif/mpif_master_sequence.e !core1_gcc12_ctrl : HDLC_CORE1_GCC_CTRL_12 vr_ad_reg;

how can I solve it?

Upvotes: 0

Views: 34

Answers (1)

user3467290
user3467290

Reputation: 781

the type of the register is GCC_CTRL_12_T. HDLC_CORE1_GCC_CTRL_12 is the name of the field.

so the sequence field should be defined as

 extend CFG_CORE_REGS vr_ad_sequence {
    !core1_gcc12_ctrl : GCC_CTRL_12_T vr_ad_reg;
  };

for defining which instance should be written, you can use the static_item as shown in the code example in vr_ad/examples/vr_ad_mult_regs.e

another option, is to use the path. eg -

 write_reg sys.env1.reg_file1.reg_0 .... 

Upvotes: 0

Related Questions