@@ -295,24 +295,9 @@ function clause execute(LOAD_FP(imm, rs1, rd, width)) = {
295
295
assert (width_bytes <= flen_bytes );
296
296
297
297
let offset : xlenbits = sign_extend (imm );
298
- /* Get the address, X(rs1) + offset.
299
- Some extensions perform additional checks on address validity. */
300
- match ext_data_get_addr (rs1 , offset , Read (Data ), width_bytes ) {
301
- Ext_DataAddr_Error (e ) => RETIRE_FAIL (Ext_DataAddr_Check_Failure (e )),
302
- Ext_DataAddr_OK (vaddr ) => {
303
- if check_misaligned (vaddr , width )
304
- then RETIRE_FAIL (Memory_Exception (vaddr , E_Load_Addr_Align ()))
305
- else match translateAddr (vaddr , Read (Data )) {
306
- TR_Failure (e , _ ) => RETIRE_FAIL (Memory_Exception (vaddr , e )),
307
- TR_Address (addr , _ ) => {
308
- let (aq , rl , res ) = (false , false , false );
309
- match mem_read (Read (Data ), addr , width_bytes , aq , rl , res ) {
310
- Ok (result ) => { F (rd ) = nan_box (result ); RETIRE_SUCCESS },
311
- Err (e ) => RETIRE_FAIL (Memory_Exception (vaddr , e )),
312
- }
313
- },
314
- }
315
- }
298
+ match vmem_read (rs1 , offset , width_bytes , false , false , false ) {
299
+ Ok (result ) => { F (rd ) = nan_box (result ); RETIRE_SUCCESS },
300
+ Err (e ) => { RETIRE_FAIL (e ) }
316
301
}
317
302
}
318
303
@@ -355,31 +340,10 @@ function clause execute (STORE_FP(imm, rs2, rs1, width)) = {
355
340
assert (width_bytes <= flen_bytes );
356
341
357
342
let offset : xlenbits = sign_extend (imm );
358
- let (aq , rl , con ) = (false , false , false );
359
- /* Get the address, X(rs1) + offset.
360
- Some extensions perform additional checks on address validity. */
361
- match ext_data_get_addr (rs1 , offset , Write (Data ), width_bytes ) {
362
- Ext_DataAddr_Error (e ) => RETIRE_FAIL (Ext_DataAddr_Check_Failure (e )),
363
- Ext_DataAddr_OK (vaddr ) => {
364
- if check_misaligned (vaddr , width )
365
- then RETIRE_FAIL (Memory_Exception (vaddr , E_SAMO_Addr_Align ()))
366
- else match translateAddr (vaddr , Write (Data )) {
367
- TR_Failure (e , _ ) => RETIRE_FAIL (Memory_Exception (vaddr , e )),
368
- TR_Address (addr , _ ) => {
369
- match mem_write_ea (addr , width_bytes , aq , rl , false ) {
370
- Err (e ) => RETIRE_FAIL (Memory_Exception (vaddr , e )),
371
- Ok (_ ) => {
372
- let rs2_val = F (rs2 );
373
- match mem_write_value (addr , width_bytes , rs2_val [width_bytes * 8 - 1 .. 0 ], aq , rl , con ) {
374
- Ok (true ) => RETIRE_SUCCESS ,
375
- Ok (false ) => { internal_error (__FILE__, __LINE__, "store got false from mem_write_value" ) },
376
- Err (e ) => RETIRE_FAIL (Memory_Exception (vaddr , e ))
377
- }
378
- },
379
- }
380
- }
381
- }
382
- }
343
+ match vmem_write (rs1 , offset , width_bytes , rs2 ) {
344
+ Ok (true ) => RETIRE_SUCCESS ,
345
+ Ok (false ) => internal_error (__FILE__, __LINE__, "store got false from vmem_write" ),
346
+ Err (e ) => RETIRE_FAIL (e ),
383
347
}
384
348
}
385
349
0 commit comments