vt52-fpga  1.0.0 Initial
vt52-fpga is a serial terminal implemented on a FPGA
usb_fs_in_arb.v
Go to the documentation of this file.
1 module usb_fs_in_arb #(
2  parameter NUM_IN_EPS = 1
3 ) (
4  ////////////////////
5  // endpoint interface
6  ////////////////////
7  input [NUM_IN_EPS-1:0] in_ep_req,
8  output reg [NUM_IN_EPS-1:0] in_ep_grant,
9  input [(NUM_IN_EPS*8)-1:0] in_ep_data,
10 
11 
12  ////////////////////
13  // protocol engine interface
14  ////////////////////
15  output reg [7:0] arb_in_ep_data
16 );
17  integer i;
18  reg grant;
19 
20  always @* begin
21  grant = 0;
22 
23  arb_in_ep_data <= 0;
24 
25  for (i = 0; i < NUM_IN_EPS; i = i + 1) begin
26  in_ep_grant[i] <= 0;
27 
28  if (in_ep_req[i] && !grant) begin
29  in_ep_grant[i] <= 1;
30  arb_in_ep_data <= in_ep_data[i * 8 +: 8];
31  grant = 1;
32  end
33  end
34 
35  // if (!grant) begin
36  // arb_in_ep_data <= 0;
37  // end
38  end
39 endmodule
module usb_fs_in_arb(input[NUM_IN_EPS-1:0] in_ep_req, output reg< NUM_IN_EPS-1:0 > in_ep_grant, input[(NUM_IN_EPS *8) -1:0] in_ep_data, output reg< 7:0 > arb_in_ep_data)
Definition: usb_fs_in_arb.v:3
always(posedge clk)
Definition: uart_rx.v:86