Skip to content

Commit

Permalink
Merge branch 'update-kbus-addressing' into 'master'
Browse files Browse the repository at this point in the history
Update kbus addressing

See merge request internal/sw-design/ts-spect-compiler!27
  • Loading branch information
tsvmasek committed Feb 23, 2024
2 parents b49e073 + 24939ad commit 0abe3b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/ISAv0.2/isav0.2.tex
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@
LDK op1,op2,Immediate & Load key & op1 = KBUS_READ[type,slot,offset] where\newline
type = Immediate[11:8]\newline
slot = op2[7:0]\newline
offset = Immediate[4:0] * 8 & E & -- \Ttlb
offset = Immediate[2:0] * 32 & E & -- \Ttlb
STK op1,op2,Immediate & Load key & KBUS_WRITE[key,type,slot,offset] where\newline
key = op1\newline
type = Immediate[11:8]\newline
slot = op2[7:0]\newline
offset = Immediate[4:0] * 8 & E & -- \Ttlb
offset = Immediate[2:0] * 32 & E & -- \Ttlb
KBO op2,Immediate & KBUS OP & KBUS_OP[type,slot,op] where\newline
type = Immediate[11:8]\newline
slot = op2[7:0]\newline
Expand Down
4 changes: 2 additions & 2 deletions src/spect_lib/InstructionDefsV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ bool spect::V2InstructionLDK::Execute()
// Read
uint256_t tmp = 0;
for (int i = 0; i < 8; i++) {
DEFINE_CHANGE(ch_kbus, DPI_CHANGE_KBUS, KBUS_OBJ_ENCODE(DPI_KBUS_LDK_READ, type, slot, (offset*8+i)));
DEFINE_CHANGE(ch_kbus, DPI_CHANGE_KBUS, KBUS_OBJ_ENCODE(DPI_KBUS_LDK_READ, type, slot, (offset*8+i)<<2));

// If running with CPU Simulator, preload key from simulator Key Memory to queue
if (model_->simulator_ != NULL) {
Expand Down Expand Up @@ -857,7 +857,7 @@ bool spect::V2InstructionSTK::Execute()
// Write
uint256_t tmp = model_->GetGpr(TO_INT(op1_));
for (int i = 0; i < 8; i++) {
DEFINE_CHANGE(ch_kbus, DPI_CHANGE_KBUS, KBUS_OBJ_ENCODE(DPI_KBUS_STK_WRITE, type, slot, (offset*8+i)));
DEFINE_CHANGE(ch_kbus, DPI_CHANGE_KBUS, KBUS_OBJ_ENCODE(DPI_KBUS_STK_WRITE, type, slot, (offset*8+i)<<2));
ch_kbus.new_val[0] = uint32_t(tmp >> (32 * i));
model_->ReportChange(ch_kbus);

Expand Down

0 comments on commit 0abe3b7

Please sign in to comment.