Skip to content

Commit

Permalink
WIP: Function Controller: Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fhaus1 committed Nov 21, 2024
1 parent a51c156 commit cab1f34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
20 changes: 4 additions & 16 deletions hw/newusb/new_usb_listservice.sv
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,19 @@
//
// Fabian Hauser <[email protected]>
//
/// Services the lists of the four channel types and feeds the DMA with the it.
/// Services the lists of the four channel types and feeds the DMA with it.
/// One ED address comes into the module, one ED address goes out of the module. No register latency.

// One ED comes into the module, one goes out of the module. No register latency.

// Todo: implement device write back or do on different module
// add missing td
// when first TD of ED is initiated ED is served. Maybe increase counter after td and not ed.
// rewrite with listfilled
// scheduling overrun SOC
// init x axi
// dma init x axi
// HCAA


// Todo: implement interrupt done, back to nonperiodic
// if interrupt done do periodic_frame 0

module new_usb_listservice import new_usb_ohci_pkg::*; #(
//parameters
) (
module new_usb_listservice import new_usb_ohci_pkg::*; (

input logic clk_i,
input logic rst_ni,
Expand Down Expand Up @@ -67,12 +61,6 @@ module new_usb_listservice import new_usb_ohci_pkg::*; #(
output logic dmawriteorread_o, // write high, read low
output channel current_type_o,
output logic current_ed_o,

output logic activebulkhead,
output logic activecontrolhead,
input logic activebulkheadprocessed,
input logic activecontrolheadprocessed,
input logic activeaddress, // First ED address coming from head

);

Expand Down
11 changes: 4 additions & 7 deletions hw/newusb/new_usb_ohci.sv
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ package new_usb_ohci_pkg;
ISOTD = 2'b10
} store_type;


// OHCI supports between 1-15 ports
localparam int unsigned NumPhyPorts = 2;
localparam state_activate OverProtect = OFF; // no overcurrent protection implemented yet
localparam state_activate PowerSwitching = OFF; // no power switching implemented yet
localparam state_permit InterruptRouting = DISABLE; // no system management interrupt (SMI) implemented yet
localparam state_permit RemoteWakeup = DISABLE; // no remote wakeup implemented yet
localparam state_permit OwnershipChange = DISABLE; // no ownership change implemented yet
localparam int unsigned FifodepthPort = 1024; // test value
localparam int unsigned Dmalength = 128; // test value
localparam int unsigned FifoDepthPort = 1024; // test value
localparam int unsigned DmaLength = 128; // test value
localparam int unsigned DmaDataWidth = 32; // 32|64|128 causes 4|2|1 stages in the dmaoutputqueueED

// Todo: Maybe Crc16 input Byte size parameter with selectable parallel/pipelined processing, lookup table?

Expand Down Expand Up @@ -118,7 +118,6 @@ module new_usb_ohci import new_usb_ohci_pkg::*; #(

// listservice
logic start; // start if USB goes to operational
logic frame_request;
logic nextis_valid;
logic nextis_ed;
channel nextis_type;
Expand Down Expand Up @@ -167,13 +166,11 @@ module new_usb_ohci import new_usb_ohci_pkg::*; #(
);

new_usb_unpackdescriptors i_new_usb_unpackdescriptors (
.cbsr_i(reg2hw.hccontrol.cbsr.q),
)
module new_usb_unpackdescriptors import new_usb_ohci_pkg::*;(
/// control
.clk_i,
.rst_ni,
.counter_is_threshold_o,
.cbsr_i(reg2hw.hccontrol.cbsr.q),

.nextis_valid_o // needs to be one clock cycle
.nextis_ed_o, // 0 if empty ed rerequest or td
Expand Down

0 comments on commit cab1f34

Please sign in to comment.