udb 0.1.9 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.data/cfgs/example_rv64_with_overlay.yaml +5 -2
- data/.data/cfgs/mc100-32-full-example.yaml +1 -0
- data/.data/cfgs/profile/README.adoc +10 -0
- data/.data/cfgs/profile/RVA20S64.yaml +26 -6
- data/.data/cfgs/profile/RVA20U64.yaml +18 -4
- data/.data/cfgs/profile/RVA22S64.yaml +27 -7
- data/.data/cfgs/profile/RVA22U64.yaml +18 -4
- data/.data/cfgs/profile/RVA23S64.yaml +61 -7
- data/.data/cfgs/profile/RVA23U64.yaml +36 -4
- data/.data/cfgs/profile/RVB23S64.yaml +27 -7
- data/.data/cfgs/profile/RVB23U64.yaml +18 -4
- data/.data/cfgs/profile/RVI20U32.yaml +10 -4
- data/.data/cfgs/profile/RVI20U64.yaml +10 -4
- data/.data/cfgs/qc_iu.yaml +4 -1
- data/.data/cfgs/rv32-riscv-tests.yaml +2 -1
- data/.data/cfgs/rv32-vector.yaml +2 -1
- data/.data/cfgs/rv64-riscv-tests.yaml +2 -1
- data/.data/cfgs/rv64-vector.yaml +2 -1
- data/.data/spec/custom/isa/qc_iu/csr/Smrnmi/mnepc.yaml +17 -0
- data/.data/spec/custom/isa/qc_iu/csr/Xqccmi/qc.itba.yaml +45 -0
- data/.data/spec/custom/isa/qc_iu/csr/Xqccmi/qc.itdec.yaml +39 -0
- data/.data/spec/custom/isa/qc_iu/csr/jvt.yaml +11 -0
- data/.data/spec/custom/isa/qc_iu/csr/mepc.yaml +16 -0
- data/.data/spec/custom/isa/qc_iu/ext/Xqccmi.yaml +219 -0
- data/.data/spec/custom/isa/qc_iu/ext/Xqccmt.yaml +127 -0
- data/.data/spec/custom/isa/qc_iu/inst/Xqccmi/qc.cm.ilut.yaml +153 -0
- data/.data/spec/custom/isa/qc_iu/inst/Xqccmt/qc.cm.jalt.yaml +84 -0
- data/.data/spec/custom/isa/qc_iu/inst/Xqccmt/qc.cm.jt.yaml +60 -0
- data/.data/spec/custom/isa/qc_iu/isa/globals.isa +112 -0
- data/.data/spec/schemas/config_schema.json +219 -26
- data/.data/spec/schemas/csr_schema.json +0 -6
- data/.data/spec/schemas/ext_schema.json +80 -24
- data/.data/spec/schemas/inst_schema.json +0 -3
- data/.data/spec/schemas/profile_release_schema.json +1 -1
- data/.data/spec/schemas/profile_schema.json +0 -3
- data/.data/spec/schemas/register_file_schema.json +8 -3
- data/.data/spec/schemas/schema_defs.json +8 -27
- data/.data/spec/std/isa/csr/I/pmpcfg0.yaml +8 -8
- data/.data/spec/std/isa/csr/I/pmpcfg1.yaml +4 -4
- data/.data/spec/std/isa/csr/I/pmpcfg10.yaml +8 -8
- data/.data/spec/std/isa/csr/I/pmpcfg11.yaml +4 -4
- data/.data/spec/std/isa/csr/I/pmpcfg12.yaml +8 -8
- data/.data/spec/std/isa/csr/I/pmpcfg13.yaml +4 -4
- data/.data/spec/std/isa/csr/I/pmpcfg14.yaml +8 -8
- data/.data/spec/std/isa/csr/I/pmpcfg15.yaml +4 -4
- data/.data/spec/std/isa/csr/I/pmpcfg2.yaml +8 -8
- data/.data/spec/std/isa/csr/I/pmpcfg3.yaml +4 -4
- data/.data/spec/std/isa/csr/I/pmpcfg4.yaml +8 -8
- data/.data/spec/std/isa/csr/I/pmpcfg5.yaml +4 -4
- data/.data/spec/std/isa/csr/I/pmpcfg6.yaml +8 -8
- data/.data/spec/std/isa/csr/I/pmpcfg7.yaml +4 -4
- data/.data/spec/std/isa/csr/I/pmpcfg8.yaml +8 -8
- data/.data/spec/std/isa/csr/I/pmpcfg9.yaml +4 -4
- data/.data/spec/std/isa/csr/I/pmpcfgN.layout +1 -1
- data/.data/spec/std/isa/csr/Zicntr/mcountinhibit.layout +6 -2
- data/.data/spec/std/isa/csr/Zicntr/mcountinhibit.yaml +6 -2
- data/.data/spec/std/isa/csr/hstatus.yaml +16 -0
- data/.data/spec/std/isa/csr/mcycleh.yaml +1 -1
- data/.data/spec/std/isa/csr/misa.yaml +0 -12
- data/.data/spec/std/isa/csr/mstatus.yaml +38 -0
- data/.data/spec/std/isa/csr/mstatush.yaml +17 -15
- data/.data/spec/std/isa/csr/senvcfg.yaml +16 -0
- data/.data/spec/std/isa/csr/sstatus.yaml +12 -0
- data/.data/spec/std/isa/csr/vsstatus.yaml +24 -0
- data/.data/spec/std/isa/ext/A.yaml +5 -7
- data/.data/spec/std/isa/ext/S.yaml +12 -0
- data/.data/spec/std/isa/ext/Smpmpmt.yaml +52 -0
- data/.data/spec/std/isa/ext/Sv32.yaml +7 -19
- data/.data/spec/std/isa/ext/Sv39.yaml +7 -19
- data/.data/spec/std/isa/ext/Sv48.yaml +4 -20
- data/.data/spec/std/isa/ext/Sv57.yaml +4 -20
- data/.data/spec/std/isa/ext/Svukte.yaml +71 -0
- data/.data/spec/std/isa/ext/Zawrs.yaml +1 -1
- data/.data/spec/std/isa/ext/Zihpm.yaml +0 -12
- data/.data/spec/std/isa/inst/C/c.addi.yaml +1 -0
- data/.data/spec/std/isa/inst/C/c.addi16sp.yaml +1 -0
- data/.data/spec/std/isa/inst/C/c.addiw.yaml +1 -0
- data/.data/spec/std/isa/inst/C/c.andi.yaml +1 -0
- data/.data/spec/std/isa/inst/C/c.ldsp.yaml +1 -1
- data/.data/spec/std/isa/inst/C/c.li.yaml +1 -0
- data/.data/spec/std/isa/inst/C/c.lui.yaml +1 -0
- data/.data/spec/std/isa/inst/C/c.mv.yaml +1 -1
- data/.data/spec/std/isa/inst/C/c.sdsp.yaml +1 -1
- data/.data/spec/std/isa/inst/D/fsgnj.d.yaml +3 -0
- data/.data/spec/std/isa/inst/D/fsgnjn.d.yaml +3 -0
- data/.data/spec/std/isa/inst/D/fsgnjx.d.yaml +3 -0
- data/.data/spec/std/isa/inst/F/fadd.s.yaml +5 -5
- data/.data/spec/std/isa/inst/F/fclass.s.yaml +2 -2
- data/.data/spec/std/isa/inst/F/fcvt.l.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fcvt.lu.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fcvt.s.l.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fcvt.s.lu.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fcvt.s.w.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fcvt.s.wu.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fcvt.w.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fcvt.wu.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fdiv.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/feq.s.yaml +2 -2
- data/.data/spec/std/isa/inst/F/fle.s.yaml +2 -2
- data/.data/spec/std/isa/inst/F/fleq.s.yaml +2 -2
- data/.data/spec/std/isa/inst/F/flt.s.yaml +2 -2
- data/.data/spec/std/isa/inst/F/fltq.s.yaml +2 -2
- data/.data/spec/std/isa/inst/F/flw.yaml +2 -2
- data/.data/spec/std/isa/inst/F/fmadd.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fmax.s.yaml +6 -6
- data/.data/spec/std/isa/inst/F/fmin.s.yaml +6 -6
- data/.data/spec/std/isa/inst/F/fmsub.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fmul.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fmv.w.x.yaml +2 -2
- data/.data/spec/std/isa/inst/F/fmv.x.w.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fnmadd.s.yaml +2 -2
- data/.data/spec/std/isa/inst/F/fnmsub.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fsgnj.s.yaml +4 -4
- data/.data/spec/std/isa/inst/F/fsgnjn.s.yaml +3 -3
- data/.data/spec/std/isa/inst/F/fsgnjx.s.yaml +4 -4
- data/.data/spec/std/isa/inst/F/fsqrt.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fsub.s.yaml +1 -1
- data/.data/spec/std/isa/inst/F/fsw.yaml +1 -1
- data/.data/spec/std/isa/inst/I/addi.yaml +1 -1
- data/.data/spec/std/isa/inst/I/addiw.yaml +1 -1
- data/.data/spec/std/isa/inst/I/andi.yaml +1 -1
- data/.data/spec/std/isa/inst/I/beq.yaml +1 -1
- data/.data/spec/std/isa/inst/I/bge.yaml +4 -2
- data/.data/spec/std/isa/inst/I/bgeu.yaml +3 -0
- data/.data/spec/std/isa/inst/I/blt.yaml +4 -2
- data/.data/spec/std/isa/inst/I/bltu.yaml +3 -0
- data/.data/spec/std/isa/inst/I/bne.yaml +1 -1
- data/.data/spec/std/isa/inst/I/slt.yaml +2 -2
- data/.data/spec/std/isa/inst/I/sltiu.yaml +1 -1
- data/.data/spec/std/isa/inst/I/sltu.yaml +1 -1
- data/.data/spec/std/isa/inst/I/sub.yaml +1 -1
- data/.data/spec/std/isa/inst/I/subw.yaml +1 -1
- data/.data/spec/std/isa/inst/I/xori.yaml +1 -1
- data/.data/spec/std/isa/inst/M/mul.yaml +0 -19
- data/.data/spec/std/isa/inst/Q/fsgnj.q.yaml +1 -1
- data/.data/spec/std/isa/inst/S/sret.yaml +3 -1
- data/.data/spec/std/isa/inst/V/vadd.vv.yaml +1 -5
- data/.data/spec/std/isa/inst/V/vfsgnjn.vv.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vfsgnjx.vv.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vl1re8.v.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vl2re8.v.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vl4re8.v.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vl8re8.v.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vle8.v.yaml +3 -8
- data/.data/spec/std/isa/inst/V/vmand.mm.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmfle.vv.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmflt.vv.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmnand.mm.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmsgt.vi.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmsgtu.vi.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmsle.vi.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmsle.vv.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmsleu.vi.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmsleu.vv.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmslt.vv.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmsltu.vv.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmv.v.i.yaml +2 -13
- data/.data/spec/std/isa/inst/V/vmv.x.s.yaml +1 -1
- data/.data/spec/std/isa/inst/V/vmxnor.mm.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vmxor.mm.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vnsrl.wx.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vrsub.vx.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vse8.v.yaml +3 -4
- data/.data/spec/std/isa/inst/V/vwadd.vx.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vwaddu.vx.yaml +3 -0
- data/.data/spec/std/isa/inst/V/vxor.vi.yaml +4 -0
- data/.data/spec/std/isa/inst/Zalasr/lSIZE.AQRL.layout +40 -5
- data/.data/spec/std/isa/inst/Zalasr/lb.aq.yaml +17 -1
- data/.data/spec/std/isa/inst/Zalasr/lb.aqrl.yaml +17 -1
- data/.data/spec/std/isa/inst/Zalasr/ld.aq.yaml +17 -1
- data/.data/spec/std/isa/inst/Zalasr/ld.aqrl.yaml +17 -1
- data/.data/spec/std/isa/inst/Zalasr/lh.aq.yaml +17 -1
- data/.data/spec/std/isa/inst/Zalasr/lh.aqrl.yaml +17 -1
- data/.data/spec/std/isa/inst/Zalasr/lw.aq.yaml +17 -1
- data/.data/spec/std/isa/inst/Zalasr/lw.aqrl.yaml +17 -1
- data/.data/spec/std/isa/inst/Zalasr/sSIZE.AQRL.layout +46 -5
- data/.data/spec/std/isa/inst/Zalasr/sb.aqrl.yaml +16 -1
- data/.data/spec/std/isa/inst/Zalasr/sb.rl.yaml +16 -1
- data/.data/spec/std/isa/inst/Zalasr/sd.aqrl.yaml +16 -1
- data/.data/spec/std/isa/inst/Zalasr/sd.rl.yaml +16 -1
- data/.data/spec/std/isa/inst/Zalasr/sh.aqrl.yaml +16 -1
- data/.data/spec/std/isa/inst/Zalasr/sh.rl.yaml +16 -1
- data/.data/spec/std/isa/inst/Zalasr/sw.aqrl.yaml +16 -1
- data/.data/spec/std/isa/inst/Zalasr/sw.rl.yaml +16 -1
- data/.data/spec/std/isa/inst/Zbkb/packw.yaml +1 -1
- data/.data/spec/std/isa/inst/Zcd/c.fld.yaml +1 -1
- data/.data/spec/std/isa/inst/Zcd/c.fldsp.yaml +1 -1
- data/.data/spec/std/isa/inst/Zcd/c.fsdsp.yaml +1 -1
- data/.data/spec/std/isa/inst/Zcf/c.flwsp.yaml +1 -1
- data/.data/spec/std/isa/inst/Zcf/c.fswsp.yaml +1 -1
- data/.data/spec/std/isa/inst/Zcmp/cm.pop.yaml +1 -1
- data/.data/spec/std/isa/inst/Zcmp/cm.popret.yaml +1 -1
- data/.data/spec/std/isa/inst/Zcmp/cm.popretz.yaml +1 -1
- data/.data/spec/std/isa/inst/Zcmp/cm.push.yaml +2 -3
- data/.data/spec/std/isa/inst/Zfa/fround.s.yaml +1 -1
- data/.data/spec/std/isa/inst/Zfh/fcvt.h.s.yaml +6 -6
- data/.data/spec/std/isa/inst/Zfh/fcvt.s.h.yaml +5 -5
- data/.data/spec/std/isa/inst/Zfh/flh.yaml +1 -1
- data/.data/spec/std/isa/inst/Zfh/fmv.h.x.yaml +1 -1
- data/.data/spec/std/isa/inst/Zfh/fmv.x.h.yaml +1 -1
- data/.data/spec/std/isa/inst/Zfh/fsh.yaml +1 -1
- data/.data/spec/std/isa/inst/Zicsr/csrrc.yaml +1 -1
- data/.data/spec/std/isa/inst/Zicsr/csrrci.yaml +1 -1
- data/.data/spec/std/isa/inst/Zicsr/csrrs.yaml +2 -2
- data/.data/spec/std/isa/inst/Zicsr/csrrsi.yaml +1 -1
- data/.data/spec/std/isa/inst/Zicsr/csrrw.yaml +1 -1
- data/.data/spec/std/isa/inst/Zicsr/csrrwi.yaml +1 -1
- data/.data/spec/std/isa/isa/builtin_functions.idl +17 -0
- data/.data/spec/std/isa/isa/fp.idl +1 -5
- data/.data/spec/std/isa/isa/globals.isa +45 -14
- data/.data/spec/std/isa/isa/vec.idl +1 -2
- data/.data/spec/std/isa/manual_version/isa/20240411/isa_20240411.yaml +5 -5
- data/.data/spec/std/isa/param/COUNTINHIBIT_EN.yaml +8 -2
- data/.data/spec/std/isa/param/JVT_BASE_MASK.yaml +1 -1
- data/.data/spec/std/isa/param/MCOUNTINHIBIT_IMPLEMENTED.yaml +25 -0
- data/.data/spec/std/isa/param/MTVEC_MODES.yaml +10 -3
- data/.data/spec/std/isa/param/VLEN.yaml +2 -0
- data/.data/spec/std/isa/profile/RVA20S64.yaml +11 -4
- data/.data/spec/std/isa/profile/RVA20U64.yaml +14 -5
- data/.data/spec/std/isa/profile/RVA22S64.yaml +14 -3
- data/.data/spec/std/isa/profile/RVA22U64.yaml +8 -1
- data/.data/spec/std/isa/profile/RVA23S64.yaml +13 -0
- data/.data/spec/std/isa/profile/RVA23U64.yaml +15 -1
- data/.data/spec/std/isa/profile/RVB23S64.yaml +15 -3
- data/.data/spec/std/isa/profile/RVB23U64.yaml +8 -1
- data/.data/spec/std/isa/profile/RVI20U32.yaml +8 -1
- data/.data/spec/std/isa/profile/RVI20U64.yaml +7 -0
- data/.data/spec/std/isa/register_file/F.yaml +3 -2
- data/.data/spec/std/isa/register_file/V.yaml +2 -2
- data/.data/spec/std/isa/register_file/X.yaml +2 -1
- data/lib/udb/architecture.rb +4 -25
- data/lib/udb/cfg_arch.rb +171 -59
- data/lib/udb/cli.rb +10 -1
- data/lib/udb/condition.rb +38 -37
- data/lib/udb/config.rb +72 -6
- data/lib/udb/logic.rb +29 -56
- data/lib/udb/obj/csr.rb +23 -5
- data/lib/udb/obj/csr_field.rb +36 -21
- data/lib/udb/obj/database_obj.rb +2 -5
- data/lib/udb/obj/extension.rb +0 -3
- data/lib/udb/obj/instruction.rb +1 -4
- data/lib/udb/obj/portfolio.rb +75 -20
- data/lib/udb/obj/profile.rb +0 -4
- data/lib/udb/obj/register_file.rb +63 -2
- data/lib/udb/portfolio_design.rb +3 -6
- data/lib/udb/resolver.rb +84 -23
- data/lib/udb/version.rb +1 -1
- data/lib/udb/version_spec.rb +8 -0
- data/lib/udb/z3.rb +23 -0
- data/lib/udb.rb +0 -3
- metadata +25 -37
- data/.data/cfgs/profile/RVA23M64.yaml +0 -159
- data/.data/cfgs/profile/RVB23M64.yaml +0 -149
- data/.data/spec/schemas/proc_cert_class_schema.json +0 -35
- data/.data/spec/schemas/proc_cert_model_schema.json +0 -336
- data/.data/spec/std/isa/proc_cert_class/AC.yaml +0 -13
- data/.data/spec/std/isa/proc_cert_class/MC.yaml +0 -13
- data/.data/spec/std/isa/proc_cert_class/RVI.yaml +0 -16
- data/.data/spec/std/isa/proc_cert_model/AC100.yaml +0 -72
- data/.data/spec/std/isa/proc_cert_model/AC200.yaml +0 -58
- data/.data/spec/std/isa/proc_cert_model/MC100-32.yaml +0 -155
- data/.data/spec/std/isa/proc_cert_model/MC100-64.yaml +0 -21
- data/.data/spec/std/isa/proc_cert_model/MC200-32.yaml +0 -60
- data/.data/spec/std/isa/proc_cert_model/MC200-64.yaml +0 -21
- data/.data/spec/std/isa/proc_cert_model/MC300-32.yaml +0 -40
- data/.data/spec/std/isa/proc_cert_model/MC300-64.yaml +0 -21
- data/.data/spec/std/isa/proc_cert_model/RVI20-32.yaml +0 -39
- data/.data/spec/std/isa/proc_cert_model/RVI20-64.yaml +0 -19
- data/.data/spec/std/isa/profile/RVA23M64.yaml +0 -24
- data/.data/spec/std/isa/profile/RVB23M64.yaml +0 -86
- data/lib/udb/cert_normative_rule.rb +0 -41
- data/lib/udb/obj/certifiable_obj.rb +0 -21
- data/lib/udb/obj/certificate.rb +0 -230
- data/lib/udb/proc_cert_design.rb +0 -77
|
@@ -31,9 +31,8 @@ data_independent_timing: false
|
|
|
31
31
|
operation(): |
|
|
32
32
|
XReg virtual_address = X[xs1];
|
|
33
33
|
# "A simple in-order implementation can ignore the settings and simply execute all vector instructions using the undisturbed policy"
|
|
34
|
-
for (U32 i =
|
|
35
|
-
U32 start_bit_pos =
|
|
34
|
+
for (U32 i = CSR[vstart].VALUE; i < CSR[vl].VALUE; i++) {
|
|
35
|
+
U32 start_bit_pos = i * 8;
|
|
36
36
|
U32 end_bit_pos = start_bit_pos + 7;
|
|
37
|
-
write_memory(8, virtual_address,
|
|
38
|
-
virtual_address = virtual_address + 1;
|
|
37
|
+
write_memory(8, virtual_address + i, V[vs3][end_bit_pos:start_bit_pos], $encoding);
|
|
39
38
|
}
|
|
@@ -22,6 +22,7 @@ encoding:
|
|
|
22
22
|
location: 24-20
|
|
23
23
|
- name: imm
|
|
24
24
|
location: 19-15
|
|
25
|
+
sign_extend: true
|
|
25
26
|
- name: vd
|
|
26
27
|
location: 11-7
|
|
27
28
|
access:
|
|
@@ -29,5 +30,8 @@ access:
|
|
|
29
30
|
u: always
|
|
30
31
|
vs: always
|
|
31
32
|
vu: always
|
|
33
|
+
pseudoinstructions:
|
|
34
|
+
- when: imm == -1
|
|
35
|
+
to: vnot.v vd, vs2, vm
|
|
32
36
|
data_independent_timing: false
|
|
33
37
|
operation(): |
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
raise "'rl' must be defined as true or false" unless [true, false].include?(rl)
|
|
8
8
|
|
|
9
9
|
size_info = {
|
|
10
|
-
"b" => { funct3: "000", long_name_suffix: "Byte" },
|
|
11
|
-
"h" => { funct3: "001", long_name_suffix: "Halfword" },
|
|
12
|
-
"w" => { funct3: "010", long_name_suffix: "Word" },
|
|
13
|
-
"d" => { funct3: "011", long_name_suffix: "Doubleword" }
|
|
10
|
+
"b" => { funct3: "000", long_name_suffix: "Byte", bits: 8 },
|
|
11
|
+
"h" => { funct3: "001", long_name_suffix: "Halfword", bits: 16 },
|
|
12
|
+
"w" => { funct3: "010", long_name_suffix: "Word", bits: 32 },
|
|
13
|
+
"d" => { funct3: "011", long_name_suffix: "Doubleword", bits: 64 }
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
current_size = size_info[size]
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
rl_bit = rl ? "1" : "0"
|
|
20
20
|
acquire_suffix = " Acquire"
|
|
21
21
|
release_suffix = rl ? " Release" : ""
|
|
22
|
+
|
|
23
|
+
aq_bit_val = "1'b1"
|
|
24
|
+
rl_bit_val = rl ? "1'b1" : "1'b0"
|
|
25
|
+
|
|
26
|
+
alignment_bytes = current_size[:bits] / 8
|
|
22
27
|
-%>
|
|
23
28
|
|
|
24
29
|
$schema: "inst_schema.json#"
|
|
@@ -26,7 +31,30 @@ kind: instruction
|
|
|
26
31
|
name: l<%= size %><%= aq_rl_suffix %>
|
|
27
32
|
long_name: Load <%= current_size[:long_name_suffix] %><%= acquire_suffix %><%= release_suffix %>
|
|
28
33
|
description: |
|
|
29
|
-
|
|
34
|
+
Load <%= current_size[:bits] %> bits of data from the address in `xs1` into register `xd`, sign-extending
|
|
35
|
+
the result to XLEN bits.
|
|
36
|
+
<% if rl -%>
|
|
37
|
+
|
|
38
|
+
This instruction has both acquire and release semantics. No subsequent memory
|
|
39
|
+
operations (in program order) from this hart can be observed to occur before
|
|
40
|
+
this load completes, and no previous memory operations can be observed to occur
|
|
41
|
+
after this load completes.
|
|
42
|
+
<% else -%>
|
|
43
|
+
|
|
44
|
+
This instruction has acquire semantics, which means that no subsequent memory
|
|
45
|
+
operations (in program order) from this hart can be observed to occur before
|
|
46
|
+
this load completes. Acquire semantics provide ordering guarantees useful for
|
|
47
|
+
synchronization, such as reading a lock variable.
|
|
48
|
+
<% end -%>
|
|
49
|
+
<% if current_size[:bits] == 8 -%>
|
|
50
|
+
|
|
51
|
+
The address must be naturally aligned; if not, an address-misaligned or
|
|
52
|
+
access-fault exception will be raised.
|
|
53
|
+
<% else -%>
|
|
54
|
+
|
|
55
|
+
The address must be naturally aligned (<%= alignment_bytes %>-byte aligned); if not, an
|
|
56
|
+
address-misaligned or access-fault exception will be raised.
|
|
57
|
+
<% end -%>
|
|
30
58
|
definedBy:
|
|
31
59
|
extension:
|
|
32
60
|
name: Zalasr
|
|
@@ -45,3 +73,10 @@ access:
|
|
|
45
73
|
vu: always
|
|
46
74
|
data_independent_timing: false
|
|
47
75
|
operation(): |
|
|
76
|
+
XReg virtual_address = X[xs1];
|
|
77
|
+
|
|
78
|
+
if (!is_naturally_aligned(<%= current_size[:bits] %>, virtual_address)) {
|
|
79
|
+
raise(ExceptionCode::LoadAddressMisaligned, mode(), virtual_address);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
X[xd] = sext(read_memory_aligned(<%= current_size[:bits] %>, virtual_address, $encoding, <%= aq_bit_val %>, <%= rl_bit_val %>), <%= current_size[:bits] %>);
|
|
@@ -11,7 +11,16 @@ kind: instruction
|
|
|
11
11
|
name: lb.aq
|
|
12
12
|
long_name: Load Byte Acquire
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Load 8 bits of data from the address in `xs1` into register `xd`, sign-extending
|
|
15
|
+
the result to XLEN bits.
|
|
16
|
+
|
|
17
|
+
This instruction has acquire semantics, which means that no subsequent memory
|
|
18
|
+
operations (in program order) from this hart can be observed to occur before
|
|
19
|
+
this load completes. Acquire semantics provide ordering guarantees useful for
|
|
20
|
+
synchronization, such as reading a lock variable.
|
|
21
|
+
|
|
22
|
+
The address must be naturally aligned; if not, an address-misaligned or
|
|
23
|
+
access-fault exception will be raised.
|
|
15
24
|
definedBy:
|
|
16
25
|
extension:
|
|
17
26
|
name: Zalasr
|
|
@@ -30,3 +39,10 @@ access:
|
|
|
30
39
|
vu: always
|
|
31
40
|
data_independent_timing: false
|
|
32
41
|
operation(): |
|
|
42
|
+
XReg virtual_address = X[xs1];
|
|
43
|
+
|
|
44
|
+
if (!is_naturally_aligned(8, virtual_address)) {
|
|
45
|
+
raise(ExceptionCode::LoadAddressMisaligned, mode(), virtual_address);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
X[xd] = sext(read_memory_aligned(8, virtual_address, $encoding, 1'b1, 1'b0), 8);
|
|
@@ -11,7 +11,16 @@ kind: instruction
|
|
|
11
11
|
name: lb.aqrl
|
|
12
12
|
long_name: Load Byte Acquire Release
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Load 8 bits of data from the address in `xs1` into register `xd`, sign-extending
|
|
15
|
+
the result to XLEN bits.
|
|
16
|
+
|
|
17
|
+
This instruction has both acquire and release semantics. No subsequent memory
|
|
18
|
+
operations (in program order) from this hart can be observed to occur before
|
|
19
|
+
this load completes, and no previous memory operations can be observed to occur
|
|
20
|
+
after this load completes.
|
|
21
|
+
|
|
22
|
+
The address must be naturally aligned; if not, an address-misaligned or
|
|
23
|
+
access-fault exception will be raised.
|
|
15
24
|
definedBy:
|
|
16
25
|
extension:
|
|
17
26
|
name: Zalasr
|
|
@@ -30,3 +39,10 @@ access:
|
|
|
30
39
|
vu: always
|
|
31
40
|
data_independent_timing: false
|
|
32
41
|
operation(): |
|
|
42
|
+
XReg virtual_address = X[xs1];
|
|
43
|
+
|
|
44
|
+
if (!is_naturally_aligned(8, virtual_address)) {
|
|
45
|
+
raise(ExceptionCode::LoadAddressMisaligned, mode(), virtual_address);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
X[xd] = sext(read_memory_aligned(8, virtual_address, $encoding, 1'b1, 1'b1), 8);
|
|
@@ -11,7 +11,16 @@ kind: instruction
|
|
|
11
11
|
name: ld.aq
|
|
12
12
|
long_name: Load Doubleword Acquire
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Load 64 bits of data from the address in `xs1` into register `xd`, sign-extending
|
|
15
|
+
the result to XLEN bits.
|
|
16
|
+
|
|
17
|
+
This instruction has acquire semantics, which means that no subsequent memory
|
|
18
|
+
operations (in program order) from this hart can be observed to occur before
|
|
19
|
+
this load completes. Acquire semantics provide ordering guarantees useful for
|
|
20
|
+
synchronization, such as reading a lock variable.
|
|
21
|
+
|
|
22
|
+
The address must be naturally aligned (8-byte aligned); if not, an
|
|
23
|
+
address-misaligned or access-fault exception will be raised.
|
|
15
24
|
definedBy:
|
|
16
25
|
extension:
|
|
17
26
|
name: Zalasr
|
|
@@ -30,3 +39,10 @@ access:
|
|
|
30
39
|
vu: always
|
|
31
40
|
data_independent_timing: false
|
|
32
41
|
operation(): |
|
|
42
|
+
XReg virtual_address = X[xs1];
|
|
43
|
+
|
|
44
|
+
if (!is_naturally_aligned(64, virtual_address)) {
|
|
45
|
+
raise(ExceptionCode::LoadAddressMisaligned, mode(), virtual_address);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
X[xd] = sext(read_memory_aligned(64, virtual_address, $encoding, 1'b1, 1'b0), 64);
|
|
@@ -11,7 +11,16 @@ kind: instruction
|
|
|
11
11
|
name: ld.aqrl
|
|
12
12
|
long_name: Load Doubleword Acquire Release
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Load 64 bits of data from the address in `xs1` into register `xd`, sign-extending
|
|
15
|
+
the result to XLEN bits.
|
|
16
|
+
|
|
17
|
+
This instruction has both acquire and release semantics. No subsequent memory
|
|
18
|
+
operations (in program order) from this hart can be observed to occur before
|
|
19
|
+
this load completes, and no previous memory operations can be observed to occur
|
|
20
|
+
after this load completes.
|
|
21
|
+
|
|
22
|
+
The address must be naturally aligned (8-byte aligned); if not, an
|
|
23
|
+
address-misaligned or access-fault exception will be raised.
|
|
15
24
|
definedBy:
|
|
16
25
|
extension:
|
|
17
26
|
name: Zalasr
|
|
@@ -30,3 +39,10 @@ access:
|
|
|
30
39
|
vu: always
|
|
31
40
|
data_independent_timing: false
|
|
32
41
|
operation(): |
|
|
42
|
+
XReg virtual_address = X[xs1];
|
|
43
|
+
|
|
44
|
+
if (!is_naturally_aligned(64, virtual_address)) {
|
|
45
|
+
raise(ExceptionCode::LoadAddressMisaligned, mode(), virtual_address);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
X[xd] = sext(read_memory_aligned(64, virtual_address, $encoding, 1'b1, 1'b1), 64);
|
|
@@ -11,7 +11,16 @@ kind: instruction
|
|
|
11
11
|
name: lh.aq
|
|
12
12
|
long_name: Load Halfword Acquire
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Load 16 bits of data from the address in `xs1` into register `xd`, sign-extending
|
|
15
|
+
the result to XLEN bits.
|
|
16
|
+
|
|
17
|
+
This instruction has acquire semantics, which means that no subsequent memory
|
|
18
|
+
operations (in program order) from this hart can be observed to occur before
|
|
19
|
+
this load completes. Acquire semantics provide ordering guarantees useful for
|
|
20
|
+
synchronization, such as reading a lock variable.
|
|
21
|
+
|
|
22
|
+
The address must be naturally aligned (2-byte aligned); if not, an
|
|
23
|
+
address-misaligned or access-fault exception will be raised.
|
|
15
24
|
definedBy:
|
|
16
25
|
extension:
|
|
17
26
|
name: Zalasr
|
|
@@ -30,3 +39,10 @@ access:
|
|
|
30
39
|
vu: always
|
|
31
40
|
data_independent_timing: false
|
|
32
41
|
operation(): |
|
|
42
|
+
XReg virtual_address = X[xs1];
|
|
43
|
+
|
|
44
|
+
if (!is_naturally_aligned(16, virtual_address)) {
|
|
45
|
+
raise(ExceptionCode::LoadAddressMisaligned, mode(), virtual_address);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
X[xd] = sext(read_memory_aligned(16, virtual_address, $encoding, 1'b1, 1'b0), 16);
|
|
@@ -11,7 +11,16 @@ kind: instruction
|
|
|
11
11
|
name: lh.aqrl
|
|
12
12
|
long_name: Load Halfword Acquire Release
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Load 16 bits of data from the address in `xs1` into register `xd`, sign-extending
|
|
15
|
+
the result to XLEN bits.
|
|
16
|
+
|
|
17
|
+
This instruction has both acquire and release semantics. No subsequent memory
|
|
18
|
+
operations (in program order) from this hart can be observed to occur before
|
|
19
|
+
this load completes, and no previous memory operations can be observed to occur
|
|
20
|
+
after this load completes.
|
|
21
|
+
|
|
22
|
+
The address must be naturally aligned (2-byte aligned); if not, an
|
|
23
|
+
address-misaligned or access-fault exception will be raised.
|
|
15
24
|
definedBy:
|
|
16
25
|
extension:
|
|
17
26
|
name: Zalasr
|
|
@@ -30,3 +39,10 @@ access:
|
|
|
30
39
|
vu: always
|
|
31
40
|
data_independent_timing: false
|
|
32
41
|
operation(): |
|
|
42
|
+
XReg virtual_address = X[xs1];
|
|
43
|
+
|
|
44
|
+
if (!is_naturally_aligned(16, virtual_address)) {
|
|
45
|
+
raise(ExceptionCode::LoadAddressMisaligned, mode(), virtual_address);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
X[xd] = sext(read_memory_aligned(16, virtual_address, $encoding, 1'b1, 1'b1), 16);
|
|
@@ -11,7 +11,16 @@ kind: instruction
|
|
|
11
11
|
name: lw.aq
|
|
12
12
|
long_name: Load Word Acquire
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Load 32 bits of data from the address in `xs1` into register `xd`, sign-extending
|
|
15
|
+
the result to XLEN bits.
|
|
16
|
+
|
|
17
|
+
This instruction has acquire semantics, which means that no subsequent memory
|
|
18
|
+
operations (in program order) from this hart can be observed to occur before
|
|
19
|
+
this load completes. Acquire semantics provide ordering guarantees useful for
|
|
20
|
+
synchronization, such as reading a lock variable.
|
|
21
|
+
|
|
22
|
+
The address must be naturally aligned (4-byte aligned); if not, an
|
|
23
|
+
address-misaligned or access-fault exception will be raised.
|
|
15
24
|
definedBy:
|
|
16
25
|
extension:
|
|
17
26
|
name: Zalasr
|
|
@@ -30,3 +39,10 @@ access:
|
|
|
30
39
|
vu: always
|
|
31
40
|
data_independent_timing: false
|
|
32
41
|
operation(): |
|
|
42
|
+
XReg virtual_address = X[xs1];
|
|
43
|
+
|
|
44
|
+
if (!is_naturally_aligned(32, virtual_address)) {
|
|
45
|
+
raise(ExceptionCode::LoadAddressMisaligned, mode(), virtual_address);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
X[xd] = sext(read_memory_aligned(32, virtual_address, $encoding, 1'b1, 1'b0), 32);
|
|
@@ -11,7 +11,16 @@ kind: instruction
|
|
|
11
11
|
name: lw.aqrl
|
|
12
12
|
long_name: Load Word Acquire Release
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Load 32 bits of data from the address in `xs1` into register `xd`, sign-extending
|
|
15
|
+
the result to XLEN bits.
|
|
16
|
+
|
|
17
|
+
This instruction has both acquire and release semantics. No subsequent memory
|
|
18
|
+
operations (in program order) from this hart can be observed to occur before
|
|
19
|
+
this load completes, and no previous memory operations can be observed to occur
|
|
20
|
+
after this load completes.
|
|
21
|
+
|
|
22
|
+
The address must be naturally aligned (4-byte aligned); if not, an
|
|
23
|
+
address-misaligned or access-fault exception will be raised.
|
|
15
24
|
definedBy:
|
|
16
25
|
extension:
|
|
17
26
|
name: Zalasr
|
|
@@ -30,3 +39,10 @@ access:
|
|
|
30
39
|
vu: always
|
|
31
40
|
data_independent_timing: false
|
|
32
41
|
operation(): |
|
|
42
|
+
XReg virtual_address = X[xs1];
|
|
43
|
+
|
|
44
|
+
if (!is_naturally_aligned(32, virtual_address)) {
|
|
45
|
+
raise(ExceptionCode::LoadAddressMisaligned, mode(), virtual_address);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
X[xd] = sext(read_memory_aligned(32, virtual_address, $encoding, 1'b1, 1'b1), 32);
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
raise "'aq' must be defined as true or false" unless [true, false].include?(aq)
|
|
8
8
|
|
|
9
9
|
size_info = {
|
|
10
|
-
"b" => { funct3: "000", long_name_suffix: "Byte" },
|
|
11
|
-
"h" => { funct3: "001", long_name_suffix: "Halfword" },
|
|
12
|
-
"w" => { funct3: "010", long_name_suffix: "Word" },
|
|
13
|
-
"d" => { funct3: "011", long_name_suffix: "Doubleword" }
|
|
10
|
+
"b" => { funct3: "000", long_name_suffix: "Byte", bits: 8 },
|
|
11
|
+
"h" => { funct3: "001", long_name_suffix: "Halfword", bits: 16 },
|
|
12
|
+
"w" => { funct3: "010", long_name_suffix: "Word", bits: 32 },
|
|
13
|
+
"d" => { funct3: "011", long_name_suffix: "Doubleword", bits: 64 }
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
current_size = size_info[size]
|
|
@@ -19,6 +19,18 @@
|
|
|
19
19
|
aq_bit = aq ? "1" : "0"
|
|
20
20
|
acquire_suffix = aq ? " Acquire" : ""
|
|
21
21
|
release_suffix = " Release"
|
|
22
|
+
|
|
23
|
+
aq_bit_val = aq ? "1'b1" : "1'b0"
|
|
24
|
+
rl_bit_val = "1'b1"
|
|
25
|
+
|
|
26
|
+
alignment_bytes = current_size[:bits] / 8
|
|
27
|
+
|
|
28
|
+
store_slice = case size
|
|
29
|
+
when "b" then "[7:0]"
|
|
30
|
+
when "h" then "[15:0]"
|
|
31
|
+
when "w" then "[31:0]"
|
|
32
|
+
when "d" then ""
|
|
33
|
+
end
|
|
22
34
|
-%>
|
|
23
35
|
|
|
24
36
|
$schema: "inst_schema.json#"
|
|
@@ -26,7 +38,29 @@ kind: instruction
|
|
|
26
38
|
name: s<%= size %><%= aq_rl_suffix %>
|
|
27
39
|
long_name: Store <%= current_size[:long_name_suffix] %><%= acquire_suffix %><%= release_suffix %>
|
|
28
40
|
description: |
|
|
29
|
-
|
|
41
|
+
Store the lowest <%= current_size[:bits] %> bits of register `xs2` to the address in `xs1`.
|
|
42
|
+
<% if aq -%>
|
|
43
|
+
|
|
44
|
+
This instruction has both acquire and release semantics. No subsequent memory
|
|
45
|
+
operations (in program order) from this hart can be observed to occur before
|
|
46
|
+
this store completes, and no previous memory operations can be observed to occur
|
|
47
|
+
after this store completes.
|
|
48
|
+
<% else -%>
|
|
49
|
+
|
|
50
|
+
This instruction has release semantics, which means that no previous memory
|
|
51
|
+
operations (in program order) from this hart can be observed to occur after
|
|
52
|
+
this store completes. Release semantics provide ordering guarantees useful for
|
|
53
|
+
synchronization, such as writing a lock variable to release it.
|
|
54
|
+
<% end -%>
|
|
55
|
+
<% if current_size[:bits] == 8 -%>
|
|
56
|
+
|
|
57
|
+
The address must be naturally aligned; if not, an address-misaligned or
|
|
58
|
+
access-fault exception will be raised.
|
|
59
|
+
<% else -%>
|
|
60
|
+
|
|
61
|
+
The address must be naturally aligned (<%= alignment_bytes %>-byte aligned); if not, an
|
|
62
|
+
address-misaligned or access-fault exception will be raised.
|
|
63
|
+
<% end -%>
|
|
30
64
|
definedBy:
|
|
31
65
|
extension:
|
|
32
66
|
name: Zalasr
|
|
@@ -45,3 +79,10 @@ access:
|
|
|
45
79
|
vu: always
|
|
46
80
|
data_independent_timing: false
|
|
47
81
|
operation(): |
|
|
82
|
+
XReg virtual_address = X[xs1];
|
|
83
|
+
|
|
84
|
+
if (!is_naturally_aligned(<%= current_size[:bits] %>, virtual_address)) {
|
|
85
|
+
raise(ExceptionCode::StoreAmoAddressMisaligned, mode(), virtual_address);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
write_memory_aligned(<%= current_size[:bits] %>, virtual_address, X[xs2]<%= store_slice %>, $encoding, <%= aq_bit_val %>, <%= rl_bit_val %>);
|
|
@@ -11,7 +11,15 @@ kind: instruction
|
|
|
11
11
|
name: sb.aqrl
|
|
12
12
|
long_name: Store Byte Acquire Release
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Store the lowest 8 bits of register `xs2` to the address in `xs1`.
|
|
15
|
+
|
|
16
|
+
This instruction has both acquire and release semantics. No subsequent memory
|
|
17
|
+
operations (in program order) from this hart can be observed to occur before
|
|
18
|
+
this store completes, and no previous memory operations can be observed to occur
|
|
19
|
+
after this store completes.
|
|
20
|
+
|
|
21
|
+
The address must be naturally aligned; if not, an address-misaligned or
|
|
22
|
+
access-fault exception will be raised.
|
|
15
23
|
definedBy:
|
|
16
24
|
extension:
|
|
17
25
|
name: Zalasr
|
|
@@ -30,3 +38,10 @@ access:
|
|
|
30
38
|
vu: always
|
|
31
39
|
data_independent_timing: false
|
|
32
40
|
operation(): |
|
|
41
|
+
XReg virtual_address = X[xs1];
|
|
42
|
+
|
|
43
|
+
if (!is_naturally_aligned(8, virtual_address)) {
|
|
44
|
+
raise(ExceptionCode::StoreAmoAddressMisaligned, mode(), virtual_address);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
write_memory_aligned(8, virtual_address, X[xs2][7:0], $encoding, 1'b1, 1'b1);
|
|
@@ -11,7 +11,15 @@ kind: instruction
|
|
|
11
11
|
name: sb.rl
|
|
12
12
|
long_name: Store Byte Release
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Store the lowest 8 bits of register `xs2` to the address in `xs1`.
|
|
15
|
+
|
|
16
|
+
This instruction has release semantics, which means that no previous memory
|
|
17
|
+
operations (in program order) from this hart can be observed to occur after
|
|
18
|
+
this store completes. Release semantics provide ordering guarantees useful for
|
|
19
|
+
synchronization, such as writing a lock variable to release it.
|
|
20
|
+
|
|
21
|
+
The address must be naturally aligned; if not, an address-misaligned or
|
|
22
|
+
access-fault exception will be raised.
|
|
15
23
|
definedBy:
|
|
16
24
|
extension:
|
|
17
25
|
name: Zalasr
|
|
@@ -30,3 +38,10 @@ access:
|
|
|
30
38
|
vu: always
|
|
31
39
|
data_independent_timing: false
|
|
32
40
|
operation(): |
|
|
41
|
+
XReg virtual_address = X[xs1];
|
|
42
|
+
|
|
43
|
+
if (!is_naturally_aligned(8, virtual_address)) {
|
|
44
|
+
raise(ExceptionCode::StoreAmoAddressMisaligned, mode(), virtual_address);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
write_memory_aligned(8, virtual_address, X[xs2][7:0], $encoding, 1'b0, 1'b1);
|
|
@@ -11,7 +11,15 @@ kind: instruction
|
|
|
11
11
|
name: sd.aqrl
|
|
12
12
|
long_name: Store Doubleword Acquire Release
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Store the lowest 64 bits of register `xs2` to the address in `xs1`.
|
|
15
|
+
|
|
16
|
+
This instruction has both acquire and release semantics. No subsequent memory
|
|
17
|
+
operations (in program order) from this hart can be observed to occur before
|
|
18
|
+
this store completes, and no previous memory operations can be observed to occur
|
|
19
|
+
after this store completes.
|
|
20
|
+
|
|
21
|
+
The address must be naturally aligned (8-byte aligned); if not, an
|
|
22
|
+
address-misaligned or access-fault exception will be raised.
|
|
15
23
|
definedBy:
|
|
16
24
|
extension:
|
|
17
25
|
name: Zalasr
|
|
@@ -30,3 +38,10 @@ access:
|
|
|
30
38
|
vu: always
|
|
31
39
|
data_independent_timing: false
|
|
32
40
|
operation(): |
|
|
41
|
+
XReg virtual_address = X[xs1];
|
|
42
|
+
|
|
43
|
+
if (!is_naturally_aligned(64, virtual_address)) {
|
|
44
|
+
raise(ExceptionCode::StoreAmoAddressMisaligned, mode(), virtual_address);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
write_memory_aligned(64, virtual_address, X[xs2], $encoding, 1'b1, 1'b1);
|
|
@@ -11,7 +11,15 @@ kind: instruction
|
|
|
11
11
|
name: sd.rl
|
|
12
12
|
long_name: Store Doubleword Release
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Store the lowest 64 bits of register `xs2` to the address in `xs1`.
|
|
15
|
+
|
|
16
|
+
This instruction has release semantics, which means that no previous memory
|
|
17
|
+
operations (in program order) from this hart can be observed to occur after
|
|
18
|
+
this store completes. Release semantics provide ordering guarantees useful for
|
|
19
|
+
synchronization, such as writing a lock variable to release it.
|
|
20
|
+
|
|
21
|
+
The address must be naturally aligned (8-byte aligned); if not, an
|
|
22
|
+
address-misaligned or access-fault exception will be raised.
|
|
15
23
|
definedBy:
|
|
16
24
|
extension:
|
|
17
25
|
name: Zalasr
|
|
@@ -30,3 +38,10 @@ access:
|
|
|
30
38
|
vu: always
|
|
31
39
|
data_independent_timing: false
|
|
32
40
|
operation(): |
|
|
41
|
+
XReg virtual_address = X[xs1];
|
|
42
|
+
|
|
43
|
+
if (!is_naturally_aligned(64, virtual_address)) {
|
|
44
|
+
raise(ExceptionCode::StoreAmoAddressMisaligned, mode(), virtual_address);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
write_memory_aligned(64, virtual_address, X[xs2], $encoding, 1'b0, 1'b1);
|
|
@@ -11,7 +11,15 @@ kind: instruction
|
|
|
11
11
|
name: sh.aqrl
|
|
12
12
|
long_name: Store Halfword Acquire Release
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Store the lowest 16 bits of register `xs2` to the address in `xs1`.
|
|
15
|
+
|
|
16
|
+
This instruction has both acquire and release semantics. No subsequent memory
|
|
17
|
+
operations (in program order) from this hart can be observed to occur before
|
|
18
|
+
this store completes, and no previous memory operations can be observed to occur
|
|
19
|
+
after this store completes.
|
|
20
|
+
|
|
21
|
+
The address must be naturally aligned (2-byte aligned); if not, an
|
|
22
|
+
address-misaligned or access-fault exception will be raised.
|
|
15
23
|
definedBy:
|
|
16
24
|
extension:
|
|
17
25
|
name: Zalasr
|
|
@@ -30,3 +38,10 @@ access:
|
|
|
30
38
|
vu: always
|
|
31
39
|
data_independent_timing: false
|
|
32
40
|
operation(): |
|
|
41
|
+
XReg virtual_address = X[xs1];
|
|
42
|
+
|
|
43
|
+
if (!is_naturally_aligned(16, virtual_address)) {
|
|
44
|
+
raise(ExceptionCode::StoreAmoAddressMisaligned, mode(), virtual_address);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
write_memory_aligned(16, virtual_address, X[xs2][15:0], $encoding, 1'b1, 1'b1);
|
|
@@ -11,7 +11,15 @@ kind: instruction
|
|
|
11
11
|
name: sh.rl
|
|
12
12
|
long_name: Store Halfword Release
|
|
13
13
|
description: |
|
|
14
|
-
|
|
14
|
+
Store the lowest 16 bits of register `xs2` to the address in `xs1`.
|
|
15
|
+
|
|
16
|
+
This instruction has release semantics, which means that no previous memory
|
|
17
|
+
operations (in program order) from this hart can be observed to occur after
|
|
18
|
+
this store completes. Release semantics provide ordering guarantees useful for
|
|
19
|
+
synchronization, such as writing a lock variable to release it.
|
|
20
|
+
|
|
21
|
+
The address must be naturally aligned (2-byte aligned); if not, an
|
|
22
|
+
address-misaligned or access-fault exception will be raised.
|
|
15
23
|
definedBy:
|
|
16
24
|
extension:
|
|
17
25
|
name: Zalasr
|
|
@@ -30,3 +38,10 @@ access:
|
|
|
30
38
|
vu: always
|
|
31
39
|
data_independent_timing: false
|
|
32
40
|
operation(): |
|
|
41
|
+
XReg virtual_address = X[xs1];
|
|
42
|
+
|
|
43
|
+
if (!is_naturally_aligned(16, virtual_address)) {
|
|
44
|
+
raise(ExceptionCode::StoreAmoAddressMisaligned, mode(), virtual_address);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
write_memory_aligned(16, virtual_address, X[xs2][15:0], $encoding, 1'b0, 1'b1);
|