Skip to content

Commit

Permalink
cheshire_pkg: Update CVA6 AXI IDs
Browse files Browse the repository at this point in the history
Signed-off-by: Nils Wistoff <[email protected]>
  • Loading branch information
niwis committed Feb 9, 2024
1 parent 8f1dfb1 commit 3a676d7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions hw/cheshire_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -430,33 +430,34 @@ package cheshire_pkg;
// CVA6 //
////////////

// CVA6 imposes an ID width of 4, but only 6 of 16 IDs are ever used
// CVA6 imposes an ID width of 4, but only 7 of 16 IDs are ever used
localparam int unsigned Cva6IdWidth = 4;
localparam int unsigned Cva6IdsUsed = 6;
localparam int unsigned Cva6IdsUsed = 7;
typedef logic [Cva6IdWidth-1:0] cva6_id_t;
typedef int unsigned cva6_id_map_t [Cva6IdsUsed-1:0][0:1];

// Symbols for used CVA6 IDs
typedef enum cva6_id_t {
Cva6IdBypMmu = 'b1000,
Cva6IdBypLoad = 'b1001,
Cva6IdBypStore = 'b1010,
Cva6IdBypAmo = 'b1011,
Cva6IdBypAccel = 'b1010,
Cva6IdBypStore = 'b1011,
Cva6IdBypAmo = 'b1100,
Cva6IdICache = 'b0000,
Cva6IdDCache = 'b1100
Cva6IdDCache = 'b0111
} cva6_id_e;

// Choose static colocation of IDs based on how heavily used and/or critical they are
function automatic cva6_id_map_t gen_cva6_id_map(cheshire_cfg_t cfg);
case (cfg.AxiMstIdWidth)
// Provide exclusive ID to I-cache to prevent fetch blocking
1: return '{'{Cva6IdBypMmu, 0}, '{Cva6IdBypLoad, 0}, '{Cva6IdBypStore, 0},
1: return '{'{Cva6IdBypMmu, 0}, '{Cva6IdBypLoad, 0}, '{Cva6IdBypAccel, 0}, '{Cva6IdBypStore, 0},
'{Cva6IdBypAmo, 0}, '{Cva6IdICache, 1}, '{Cva6IdDCache, 0}};
// Colocate Load/Store and MMU/AMO bypasses, respectively
2: return '{'{Cva6IdBypMmu, 0}, '{Cva6IdBypLoad, 1}, '{Cva6IdBypStore, 1},
2: return '{'{Cva6IdBypMmu, 0}, '{Cva6IdBypLoad, 1}, '{Cva6IdBypAccel, 1}, '{Cva6IdBypStore, 1},
'{Cva6IdBypAmo, 0}, '{Cva6IdICache, 2}, '{Cva6IdDCache, 3}};
// Compress output ID space without any serialization
3: return '{'{Cva6IdBypMmu, 0}, '{Cva6IdBypLoad, 1}, '{Cva6IdBypStore, 2},
3: return '{'{Cva6IdBypMmu, 0}, '{Cva6IdBypLoad, 1}, '{Cva6IdBypAccel, 1}, '{Cva6IdBypStore, 2},
'{Cva6IdBypAmo, 3}, '{Cva6IdICache, 4}, '{Cva6IdDCache, 5}};
// With 4b of ID or more, no remapping is necessary
default: return '{default: '{0, 0}};
Expand Down

0 comments on commit 3a676d7

Please sign in to comment.