Skip to content

Fix reading and writing to mtimeh/mtimecmph on 64b Fabrics#15

Open
heshamelmatary wants to merge 2 commits intobluespec:masterfrom
CTSRD-CHERI:fix_near_io_reqs
Open

Fix reading and writing to mtimeh/mtimecmph on 64b Fabrics#15
heshamelmatary wants to merge 2 commits intobluespec:masterfrom
CTSRD-CHERI:fix_near_io_reqs

Conversation

@heshamelmatary
Copy link
Copy Markdown

No description provided.

Example:
li s0, (CLINT_BASE + MTIMEH_OFFSET) // 0x_xxxx_bffc
lw t0, 4(s0)

t0 won't get the correct value

mkNear_Mem_IO.rl_process_rd_req properly puts the value in the low 4-bytes of
rdata, however, MMU_Cache.rl_io_near_mem_read_rsp uses
fn_extract_and_extend_bytes which extracts the upper 4-bytes of the returned
rdata (assuming a 64-bit aligned AXI rdata is returned).

The commit properly composes a read reponse as mkNear_Mem_IO.rl_process_rd_req
expects.
Example:
li  s0, (CLINT_BASE + MTIMECMPH_OFFSET) // 0x_xxxx_4004
sw t0, 4(s0)

MMU_Cache.fn_to_fabric_write_fields composes a 64-bit wdata assuming the waddr
is always gonna be 64-bit aligned, and thus puts the requested_wdata in the
upper 4-bytes of word64 with the corresponding 0xf0 strobe.

mkNear_Mem_IO.rl_process_wr_req however, handles writes to 0xxxx_bffc/0xxxx_4004,
expecting the wdata to contain the value in the LSB (lower 4 bytes).

The commit fixes mkNear_Mem_IO.rl_process_wr_req to handle "SW" writes on 64b fabrics
by extracting the upper 4-bytes set by MMU_Cache.fn_to_fabric_write_fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant