+ -- Some SPRs are stored in the register file, they use the magic
+ -- GPR numbers above 31.
+ --
+ -- The function fast_spr_num() returns the corresponding fast
+ -- pseudo-GPR number for a given SPR number. The result MSB
+ -- indicates if this is indeed a fast SPR. If clear, then
+ -- the SPR is not stored in the GPR file.
+ --
+ function fast_spr_num(spr: spr_num_t) return gspr_index_t;
+
+ -- Indices conversion functions
+ function gspr_to_gpr(i: gspr_index_t) return gpr_index_t;
+ function gpr_to_gspr(i: gpr_index_t) return gspr_index_t;
+ function gpr_or_spr_to_gspr(g: gpr_index_t; s: gspr_index_t) return gspr_index_t;
+ function is_fast_spr(s: gspr_index_t) return std_ulogic;
+
+ -- The XER is split: the common bits (CA, OV, SO, OV32 and CA32) are
+ -- in the CR file as a kind of CR extension (with a separate write
+ -- control). The rest is stored as a fast SPR.
+ type xer_common_t is record
+ ca : std_ulogic;
+ ca32 : std_ulogic;
+ ov : std_ulogic;
+ ov32 : std_ulogic;
+ so : std_ulogic;
+ end record;
+ constant xerc_init : xer_common_t := (others => '0');
+
+ type irq_state_t is (WRITE_SRR0, WRITE_SRR1);
+
+ -- This needs to die...