mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	ebu cleanup
This commit is contained in:
		
							parent
							
								
									17fd2d2a3b
								
							
						
					
					
						commit
						94d01d292e
					
				@ -32,8 +32,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
`include "wally-config.vh"
 | 
					`include "wally-config.vh"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module controllerinputstage #(parameter SAVE_ENABLED = 1)
 | 
					module controllerinputstage #(parameter SAVE_ENABLED = 1) (
 | 
				
			||||||
  (input logic HCLK,
 | 
					  input  logic                HCLK,
 | 
				
			||||||
  input  logic                HRESETn,
 | 
					  input  logic                HRESETn,
 | 
				
			||||||
  input  logic                Save, Restore, Disable,
 | 
					  input  logic                Save, Restore, Disable,
 | 
				
			||||||
  output logic                Request,
 | 
					  output logic                Request,
 | 
				
			||||||
@ -51,7 +51,7 @@ module controllerinputstage #(parameter SAVE_ENABLED = 1)
 | 
				
			|||||||
  output logic [1:0]          HTRANSOut,
 | 
					  output logic [1:0]          HTRANSOut,
 | 
				
			||||||
  output logic [`PA_BITS-1:0] HADDROut,
 | 
					  output logic [`PA_BITS-1:0] HADDROut,
 | 
				
			||||||
  input  logic                HREADYIn
 | 
					  input  logic                HREADYIn
 | 
				
			||||||
   );
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  logic                       HWRITESave;
 | 
					  logic                       HWRITESave;
 | 
				
			||||||
  logic [2:0]                 HSIZESave;
 | 
					  logic [2:0]                 HSIZESave;
 | 
				
			||||||
 | 
				
			|||||||
@ -32,8 +32,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
`include "wally-config.vh"
 | 
					`include "wally-config.vh"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module ebu
 | 
					module ebu (
 | 
				
			||||||
  (
 | 
					 | 
				
			||||||
  input  logic                clk, reset,
 | 
					  input  logic                clk, reset,
 | 
				
			||||||
  // Signals from IFU
 | 
					  // Signals from IFU
 | 
				
			||||||
  input  logic [`PA_BITS-1:0] IFUHADDR, 
 | 
					  input  logic [`PA_BITS-1:0] IFUHADDR, 
 | 
				
			||||||
@ -55,7 +54,7 @@ module ebu
 | 
				
			|||||||
  // AHB-Lite external signals
 | 
					  // AHB-Lite external signals
 | 
				
			||||||
  (* mark_debug = "true" *) input  logic HREADY, HRESP,
 | 
					  (* mark_debug = "true" *) input  logic HREADY, HRESP,
 | 
				
			||||||
  (* mark_debug = "true" *) output logic HCLK, HRESETn,
 | 
					  (* mark_debug = "true" *) output logic HCLK, HRESETn,
 | 
				
			||||||
   (* mark_debug = "true" *) output logic [`PA_BITS-1:0] HADDR, // *** one day switch to a different bus that supports the full physical address
 | 
					  (* mark_debug = "true" *) output logic [`PA_BITS-1:0] HADDR, 
 | 
				
			||||||
  (* mark_debug = "true" *) output logic [`AHBW-1:0] HWDATA,
 | 
					  (* mark_debug = "true" *) output logic [`AHBW-1:0] HWDATA,
 | 
				
			||||||
  (* mark_debug = "true" *) output logic [`XLEN/8-1:0] HWSTRB,
 | 
					  (* mark_debug = "true" *) output logic [`XLEN/8-1:0] HWSTRB,
 | 
				
			||||||
  (* mark_debug = "true" *) output logic HWRITE, 
 | 
					  (* mark_debug = "true" *) output logic HWRITE, 
 | 
				
			||||||
@ -64,7 +63,7 @@ module ebu
 | 
				
			|||||||
  (* mark_debug = "true" *) output logic [3:0] HPROT,
 | 
					  (* mark_debug = "true" *) output logic [3:0] HPROT,
 | 
				
			||||||
  (* mark_debug = "true" *) output logic [1:0] HTRANS,
 | 
					  (* mark_debug = "true" *) output logic [1:0] HTRANS,
 | 
				
			||||||
  (* mark_debug = "true" *) output logic HMASTLOCK
 | 
					  (* mark_debug = "true" *) output logic HMASTLOCK
 | 
				
			||||||
   );
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  typedef enum                logic [1:0] {IDLE, ARBITRATE} statetype;
 | 
					  typedef enum                logic [1:0] {IDLE, ARBITRATE} statetype;
 | 
				
			||||||
  statetype                   CurrState, NextState;
 | 
					  statetype                   CurrState, NextState;
 | 
				
			||||||
@ -98,7 +97,6 @@ module ebu
 | 
				
			|||||||
  assign HCLK = clk;
 | 
					  assign HCLK = clk;
 | 
				
			||||||
  assign HRESETn = ~reset;
 | 
					  assign HRESETn = ~reset;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // if two requests come in at once pick one to select and save the others Address phase
 | 
					  // if two requests come in at once pick one to select and save the others Address phase
 | 
				
			||||||
  // inputs.  Abritration scheme is LSU always goes first.
 | 
					  // inputs.  Abritration scheme is LSU always goes first.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -146,12 +144,7 @@ module ebu
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // This part is only used when burst mode is supported.
 | 
					  // This part is only used when burst mode is supported.
 | 
				
			||||||
  // Controller needs to count beats.
 | 
					  // Controller needs to count beats.
 | 
				
			||||||
  flopenr #(4) 
 | 
					  flopenr #(4) BeatCountReg(HCLK, ~HRESETn | CntReset | FinalBeat, BeatCntEn, NextBeatCount, BeatCount);  
 | 
				
			||||||
  BeatCountReg(.clk(HCLK),
 | 
					 | 
				
			||||||
		.reset(~HRESETn | CntReset | FinalBeat),
 | 
					 | 
				
			||||||
		.en(BeatCntEn),
 | 
					 | 
				
			||||||
		.d(NextBeatCount),
 | 
					 | 
				
			||||||
		.q(BeatCount));  
 | 
					 | 
				
			||||||
  assign NextBeatCount = BeatCount + 1'b1;
 | 
					  assign NextBeatCount = BeatCount + 1'b1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  assign CntReset = NextState == IDLE;
 | 
					  assign CntReset = NextState == IDLE;
 | 
				
			||||||
@ -159,12 +152,7 @@ module ebu
 | 
				
			|||||||
  assign BeatCntEn = (NextState == ARBITRATE & HREADY);
 | 
					  assign BeatCntEn = (NextState == ARBITRATE & HREADY);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Used to store data from data phase of AHB.
 | 
					  // Used to store data from data phase of AHB.
 | 
				
			||||||
  flopenr #(1) 
 | 
					  flopenr #(1) FinalBeatReg(HCLK, ~HRESETn | CntReset, BeatCntEn, FinalBeat, FinalBeatD);
 | 
				
			||||||
  FinalBeatReg(.clk(HCLK),
 | 
					 | 
				
			||||||
		.reset(~HRESETn | CntReset),
 | 
					 | 
				
			||||||
		.en(BeatCntEn),
 | 
					 | 
				
			||||||
		.d(FinalBeat),
 | 
					 | 
				
			||||||
		.q(FinalBeatD));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // unlike the bus fsm in lsu/ifu, we need to derive the number of beats from HBURST.
 | 
					  // unlike the bus fsm in lsu/ifu, we need to derive the number of beats from HBURST.
 | 
				
			||||||
  always_comb begin
 | 
					  always_comb begin
 | 
				
			||||||
@ -176,7 +164,6 @@ module ebu
 | 
				
			|||||||
      default:  Threshold = 4'b0000; // INCR without end.
 | 
					      default:  Threshold = 4'b0000; // INCR without end.
 | 
				
			||||||
    endcase
 | 
					    endcase
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
  // end of burst mode.
 | 
					 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // basic arb always selects LSU when both
 | 
					  // basic arb always selects LSU when both
 | 
				
			||||||
  // replace this block for more sophisticated arbitration as needed.
 | 
					  // replace this block for more sophisticated arbitration as needed.
 | 
				
			||||||
@ -191,5 +178,4 @@ module ebu
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  flopr #(1) ifureqreg(clk, ~HRESETn, IFUReq, IFUReqD);
 | 
					  flopr #(1) ifureqreg(clk, ~HRESETn, IFUReq, IFUReqD);
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					 | 
				
			||||||
endmodule
 | 
					endmodule
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user