Make MVENDORID/MARCHID/MIMPID configurable
This commit is contained in:
		
							parent
							
								
									12205f12c7
								
							
						
					
					
						commit
						565b76672a
					
				|  | @ -35,6 +35,20 @@ parameter CSR_M_TRAP      = 1, | |||
| // CSR_COUNTER: Include performance counters and relevant M-mode CSRs | ||||
| parameter CSR_COUNTER     = 0, | ||||
| 
 | ||||
| // ---------------------------------------------------------------------------- | ||||
| // ID registers | ||||
| 
 | ||||
| // JEDEC JEP106-compliant vendor ID, can be left at 0 if "not implemented or | ||||
| // that this is a non-commercial implementation" (RISC-V spec). | ||||
| // 31:7 is continuation code count, 6:0 is ID. Parity bit is not stored. | ||||
| parameter MVENDORID_VAL = 32'h0, | ||||
| 
 | ||||
| // Architecture ID for Hazard3, currently 0 because unregistered. (TODO) | ||||
| parameter MARCHID_VAL = 32'h0, | ||||
| 
 | ||||
| // Implementation ID for this specific version of Hazard3. Git hash is perfect. | ||||
| parameter MIMPID_VAL = 32'h0, | ||||
| 
 | ||||
| // ---------------------------------------------------------------------------- | ||||
| // Performance/size options | ||||
| 
 | ||||
|  |  | |||
|  | @ -419,7 +419,7 @@ always @ (*) begin | |||
| 		decode_match = 1'b1; | ||||
| 		rdata = { | ||||
| 			2'h1,              // MXL: 32-bit | ||||
| 			{XLEN-28{1'b0}}, // WLRL | ||||
| 			{XLEN-28{1'b0}},   // WLRL | ||||
| 
 | ||||
| 			13'd0,             // Z...N, no | ||||
| 			|EXTENSION_M, | ||||
|  | @ -432,18 +432,15 @@ always @ (*) begin | |||
| 	end | ||||
| 	MVENDORID: if (CSR_M_MANDATORY) begin | ||||
| 		decode_match = !wen_soon; // MRO | ||||
| 		// I don't have a JEDEC ID. It is legal to tie this to 0 if non-commercial. | ||||
| 		rdata = {XLEN{1'b0}}; | ||||
| 		rdata = MVENDORID_VAL; | ||||
| 	end | ||||
| 	MARCHID: if (CSR_M_MANDATORY) begin | ||||
| 		decode_match = !wen_soon; // MRO | ||||
| 		// I don't have a RV foundation ID. It is legal to tie this to 0. | ||||
| 		rdata = {XLEN{1'b0}}; | ||||
| 		rdata = MARCHID_VAL; | ||||
| 	end | ||||
| 	MIMPID: if (CSR_M_MANDATORY) begin | ||||
| 		decode_match = !wen_soon; // MRO | ||||
| 		// TODO put git SHA or something here | ||||
| 		rdata = {XLEN{1'b0}}; | ||||
| 		rdata = MIMPID_VAL; | ||||
| 	end | ||||
| 	MHARTID: if (CSR_M_MANDATORY) begin | ||||
| 		decode_match = !wen_soon; // MRO | ||||
|  | @ -473,6 +470,10 @@ always @ (*) begin | |||
| 		}; | ||||
| 	end | ||||
| 
 | ||||
| 	// MSTATUSH is not implemented (permitted when all fields would be tied to | ||||
| 	// zero -- those fields being MBE and SBE, which are zero because we are | ||||
| 	// pure little-endian.) | ||||
| 
 | ||||
| 	// MEDELEG, MIDELEG should not exist for M-only implementations. Will raise | ||||
| 	// illegal instruction exception if accessed. | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue