Add mconfigptr CSR
This commit is contained in:
		
							parent
							
								
									fad64bb6c9
								
							
						
					
					
						commit
						c5e85dea4c
					
				
							
								
								
									
										17864
									
								
								doc/hazard3.pdf
								
								
								
								
							
							
						
						
									
										17864
									
								
								doc/hazard3.pdf
								
								
								
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
				
			
			@ -61,6 +61,18 @@ Hart identification register. Read-only, configurable constant.
 | 
			
		|||
| 31:0 | - | Hazard3 cores possess only one hardware thread, so this is a unique per-core identifier, assigned consecutively from 0.
 | 
			
		||||
|===
 | 
			
		||||
 | 
			
		||||
==== mconfigptr
 | 
			
		||||
 | 
			
		||||
Address: `0xf15`
 | 
			
		||||
 | 
			
		||||
Pointer to configuration data structure. Read-only, configurable constant.
 | 
			
		||||
 | 
			
		||||
[cols="10h,20h,~", options="header"]
 | 
			
		||||
|===
 | 
			
		||||
| Bits | Name | Description
 | 
			
		||||
| 31:0 | - | Either pointer to configuration data structure, containing information about the harts and system, or all-zeroes. At least 4-byte-aligned.
 | 
			
		||||
|===
 | 
			
		||||
 | 
			
		||||
==== mstatus
 | 
			
		||||
 | 
			
		||||
Address: `0x300`
 | 
			
		||||
| 
						 | 
				
			
			@ -315,7 +327,7 @@ Unimplemented. Access will cause an illegal instruction exception.
 | 
			
		|||
 | 
			
		||||
=== Standard Debug Mode CSRs
 | 
			
		||||
 | 
			
		||||
This section describes the Debug Mode CSRs, which are follow the 0.13.2 RISC-V debug specification. The <<debug-chapter>> section gives more detail on the remainder of Hazard3's debug implementation, including the Debug Module.
 | 
			
		||||
This section describes the Debug Mode CSRs, which follow the 0.13.2 RISC-V debug specification. The <<debug-chapter>> section gives more detail on the remainder of Hazard3's debug implementation, including the Debug Module.
 | 
			
		||||
 | 
			
		||||
All Debug Mode CSRs are 32-bit; DXLEN is always 32.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,6 +82,10 @@ parameter MIMPID_VAL = 32'h0,
 | 
			
		|||
// Each core has a single hardware thread. Multiple cores should have unique IDs.
 | 
			
		||||
parameter MHARTID_VAL     = 32'h0,
 | 
			
		||||
 | 
			
		||||
// Pointer to configuration structure blob, or all-zeroes. Must be at least
 | 
			
		||||
// 4-byte-aligned.
 | 
			
		||||
parameter MCONFIGPTR_VAL  = 32'h0,
 | 
			
		||||
 | 
			
		||||
// ----------------------------------------------------------------------------
 | 
			
		||||
// Performance/size options
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,6 +18,7 @@
 | 
			
		|||
.MVENDORID_VAL   (MVENDORID_VAL),
 | 
			
		||||
.MIMPID_VAL      (MIMPID_VAL),
 | 
			
		||||
.MHARTID_VAL     (MHARTID_VAL),
 | 
			
		||||
.MCONFIGPTR_VAL  (MCONFIGPTR_VAL),
 | 
			
		||||
.REDUCED_BYPASS  (REDUCED_BYPASS),
 | 
			
		||||
.MULDIV_UNROLL   (MULDIV_UNROLL),
 | 
			
		||||
.MUL_FAST        (MUL_FAST),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -120,6 +120,7 @@ localparam MVENDORID      = 12'hf11; // Vendor ID.
 | 
			
		|||
localparam MARCHID        = 12'hf12; // Architecture ID.
 | 
			
		||||
localparam MIMPID         = 12'hf13; // Implementation ID.
 | 
			
		||||
localparam MHARTID        = 12'hf14; // Hardware thread ID.
 | 
			
		||||
localparam MCONFIGPTR     = 12'hf15; // Pointer to configuration data structure.
 | 
			
		||||
 | 
			
		||||
// Machine Trap Setup (RW)
 | 
			
		||||
localparam MSTATUS        = 12'h300; // Machine status register.
 | 
			
		||||
| 
						 | 
				
			
			@ -616,6 +617,11 @@ always @ (*) begin
 | 
			
		|||
		rdata = MHARTID_VAL;
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	MCONFIGPTR: if (CSR_M_MANDATORY) begin
 | 
			
		||||
		decode_match = !wen_soon; // MRO
 | 
			
		||||
		rdata = MCONFIGPTR_VAL;
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	MSTATUS: if (CSR_M_MANDATORY || CSR_M_TRAP) begin
 | 
			
		||||
		decode_match = 1'b1;
 | 
			
		||||
		rdata = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue