@@ -113,7 +113,8 @@ def get_rm(opcode):
113113 'ppbrrformat' : ['rs1' , 'rs2' , 'rd' ],
114114 'prrformat' : ['rs1' , 'rs2' , 'rd' ],
115115 'prrrformat' : ['rs1' , 'rs2' , 'rs3' , 'rd' ],
116- 'dcasrformat' : ['rs1' , 'rs2' , 'rd' ]
116+ 'dcasrformat' : ['rs1' , 'rs2' , 'rd' ],
117+ 'zformat' : ['rs1' ]
117118}
118119''' Dictionary mapping instruction formats to operands used by those formats '''
119120
@@ -170,7 +171,8 @@ def get_rm(opcode):
170171 'ppbrrformat' : '["rs1_val"] + simd_val_vars("rs2", xlen, 8)' ,
171172 'prrformat' : '["rs1_val", "rs2_val"]' ,
172173 'prrrformat' : "['rs1_val', 'rs2_val' , 'rs3_val']" ,
173- 'dcasrformat' : '["rs1_val", "rs2_val"]'
174+ 'dcasrformat' : '["rs1_val", "rs2_val"]' ,
175+ 'zformat' : ['rs1' ]
174176}
175177''' Dictionary mapping instruction formats to operand value variables used by those formats '''
176178
@@ -1006,6 +1008,7 @@ def valreg(self,instr_dict):
10061008 else :
10071009 FLEN = 0
10081010 XLEN = max (self .opnode ['xlen' ])
1011+ RVMODEL_CBZ_BLOCKSIZE = XLEN
10091012 SIGALIGN = max (XLEN ,FLEN )/ 8
10101013 stride_sz = eval (suffix )
10111014 template = Template (eval (self .opnode ['val' ]['val_template' ]))
@@ -1318,7 +1321,7 @@ def reformat_instr(self, instr_dict):
13181321 value = '0x' + value [2 :].zfill (int (self .xlen / 4 ))
13191322 value = struct .unpack (size , bytes .fromhex (value [2 :]))[0 ]
13201323 else :
1321- value = int (value )
1324+ value = toint (value )
13221325# value = '0x' + struct.pack(size,value).hex()
13231326 #print("test",hex(value))
13241327 instr_dict [i ][field ] = hex (value )
@@ -1425,7 +1428,7 @@ def __write_test__(self, file_name,node,label,instr_dict, op_node, usage_str):
14251428 # dval = (instr['rs{0}_val'.format(i)],self.iflen)
14261429 data .extend (instr ['val_section' ])
14271430 if instr ['swreg' ] != sreg or eval (instr ['offset' ],{},
1428- {'FLEN' :width ,'XLEN' :self .xlen ,'SIGALIGN' :max (self .xlen ,self .flen )/ 8 }) == 0 :
1431+ {'FLEN' :width ,'XLEN' :self .xlen ,'RVMODEL_CBZ_BLOCKSIZE' : self . xlen , ' SIGALIGN' :max (self .xlen ,self .flen )/ 8 }) == 0 :
14291432 sign .append (signode_template .substitute (
14301433 {'n' :n ,'label' :"signature_" + sreg + "_" + str (regs [sreg ]),'sz' :sig_sz }))
14311434 n = stride
0 commit comments