Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2c83d8d
Initial support for 8b tx in API
ed-xmos Jan 9, 2025
596cef5
Successful non-wrapped 8b Tx at 60MHz thread speed
ed-xmos Jan 9, 2025
6c0af60
Refresh API to avoid extra braces on initialiser
ed-xmos Jan 10, 2025
e8c858c
Implement wrap checking for tx8
ed-xmos Jan 10, 2025
1d266e4
Comments and minor DI opt
ed-xmos Jan 10, 2025
d86ce13
Merge branch 'develop'
ed-xmos Feb 28, 2025
45cd085
Merge branch 'experimental/hw_test'
ed-xmos Feb 28, 2025
93248b9
Tidy merge
ed-xmos Feb 28, 2025
8f64867
Tidy bringup app
ed-xmos Feb 28, 2025
e2d1c9c
Update deps.cmake
ed-xmos Feb 28, 2025
415904a
Tidy up items - merge cleanup and use 8b port initialiser
ed-xmos Feb 28, 2025
8e73bfd
Fix cmake in tests
ed-xmos Feb 28, 2025
d7d33c4
Copyright
ed-xmos Feb 28, 2025
c235a3d
Merge branch 'develop'
ed-xmos Mar 3, 2025
0c6bdf8
Merge branch 'develop'
ed-xmos Mar 3, 2025
049b9b5
Merge branch 'develop'
ed-xmos Mar 12, 2025
8ccb40f
Fix duplicate IP
ed-xmos Mar 12, 2025
e9f3d2b
Merge branch 'develop'
ed-xmos Mar 13, 2025
781a527
Merge branch 'develop' into feature/rmii_8b_tx
humphrey-xmos Aug 28, 2025
a42308c
Updating bringup test to latest lib
humphrey-xmos Aug 28, 2025
b157f42
Merge branch 'develop' into feature/rmii_8b_tx
humphrey-xmos Aug 28, 2025
5236397
Documentation update
humphrey-xmos Aug 28, 2025
9302ed0
icmp client refactored, brought in from app-note
humphrey-xmos Aug 28, 2025
0e4e7cd
Fixing bringup test 8b select
humphrey-xmos Aug 29, 2025
e81f6db
Merge branch 'develop' into feature/rmii_8b_tx
humphrey-xmos Aug 29, 2025
acad58b
Add support for 8b tx in sim tests
Sep 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,4 @@ pipeline {
}
}
} // stages
} // pipeline
} // pipeline
2 changes: 1 addition & 1 deletion doc/rst/lib_ethernet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ Real-time Ethernet MAC supporting typedefs

.. doxygenenum:: ethernet_enable_shaper_t
.. doxygenstruct:: rmii_port_timing_t
.. doxygenenum:: rmii_data_4b_pin_assignment_t
.. doxygenenum:: rmii_data_pin_assignment_t


|newpage|
Expand Down
1 change: 0 additions & 1 deletion examples/app_ethernet_diagnostics/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ port p_phy_clk = RMII_PHY_CLK_50M;
clock phy_rxclk = on tile[0]: XS1_CLKBLK_1;
clock phy_txclk = on tile[0]: XS1_CLKBLK_2;


// An enum to manage the array of connections from the ethernet component to its clients.
enum eth_clients {
ETH_TO_TRAFFIC,
Expand Down
26 changes: 15 additions & 11 deletions lib_ethernet/api/ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ typedef interface ethernet_cfg_if {
*
* \param ifnum The index of the MAC interface to set the slope (always 0)
* \param slope The slope value in bits per 100 MHz ref timer tick in MII_CREDIT_FRACTIONAL_BITS Q format.
*
*
*/
void set_egress_qav_idle_slope(size_t ifnum, unsigned slope);

Expand All @@ -209,8 +207,6 @@ typedef interface ethernet_cfg_if {
*
* \param ifnum The index of the MAC interface to set the slope (always 0)
* \param bits_per_second The maximum number of bits per second to be set
*
*
*/
void set_egress_qav_idle_slope_bps(size_t ifnum, unsigned bits_per_second);

Expand Down Expand Up @@ -663,11 +659,16 @@ void mii_ethernet_mac(SERVER_INTERFACE(ethernet_cfg_if, i_cfg[n_cfg]), static_co

/** ENUM to determine which two bits of a four bit port are to be used as data lines
* in the case that a four bit port is specified for RMII. The other two pins of the four bit
* port cannot be used. For Rx the unused input bits are ignored. For Tx, the unused pins are always driven low. */
typedef enum rmii_data_4b_pin_assignment_t{
* port cannot be used. For Rx the input values are ignored. For Tx, the unused pins are always driven low. */
typedef enum rmii_data_pin_assignment_t{
USE_LOWER_2B = 0, /**< Use bit 0 and bit 1 of the four bit port for data bits 0 and 1*/
USE_UPPER_2B = 1 /**< Use bit 2 and bit 3 of the four bit port for data bits 0 and 1*/
} rmii_data_4b_pin_assignment_t;
} rmii_data_pin_assignment_t;


/** Macro to populate which bits of the 8b port are used in the initialiser. Unused bits are driven low. */
#define RMII_8B_PINS_INITIALISER(pos_0, pos_1) ((unsigned)pos_0 | ((unsigned)pos_1) << 16)


/** Struct containing the clock delay settings for the Rx and Tx pins. This is needed to adjust
* port timings to ensure that the data is captured with sufficient setup and hold margin.
Expand Down Expand Up @@ -708,13 +709,16 @@ typedef struct rmii_port_timing_t{
* \param rx_pin_map Which pins to use in 4 bit case. USE_LOWER_2B or USE_HIGHER_2B. Ignored if 1 bit ports used.
* \param p_rxdv RMII RX data valid port
* \param p_txen RMII TX enable port
* \param p_txd_0 Port for data bit 0 (1 bit option) or entire port (4 bit option)
* \param p_txd_0 Port for data bit 0 (1 bit option) or entire port (4 or 8 bit option)
* \param p_txd_1 Port for data bit 1 (1 bit option). Pass null if unused.
* \param tx_pin_map Which pins to use in 4 bit case. USE_LOWER_2B or USE_HIGHER_2B. Ignored if 1 bit ports used.
* In the case of 8b port usage, the lower 16b word holds the position of the data bit 0 and
* the upper 16b word holds the position of data bit 1. Values 0..7 are valid. You can use the
* RMII_8B_PINS_INITIALISER(pos_0, pos_1) macro to initialise this value.
* \param rxclk Clock used for RMII receive timing
* \param txclk Clock used for RMII transmit timing
* \param port_timing Struct used for initialising the clock blocks to ensure setup and hold times are met
*
*
* \param rx_bufsize_words The number of words to used for a receive buffer.
* This should be at least 500 long words.
* \param tx_bufsize_words The number of words to used for a transmit buffer.
Expand All @@ -730,10 +734,10 @@ void rmii_ethernet_rt_mac(SERVER_INTERFACE(ethernet_cfg_if, i_cfg[n_cfg]), stati
nullable_streaming_chanend_t c_rx_hp,
nullable_streaming_chanend_t c_tx_hp,
in_port_t p_clk,
port p_rxd_0, NULLABLE_RESOURCE(port, p_rxd_1), rmii_data_4b_pin_assignment_t rx_pin_map,
port p_rxd_0, NULLABLE_RESOURCE(port, p_rxd_1), rmii_data_pin_assignment_t rx_pin_map,
in_port_t p_rxdv,
out_port_t p_txen,
port p_txd_0, NULLABLE_RESOURCE(port, p_txd_1), rmii_data_4b_pin_assignment_t tx_pin_map,
port p_txd_0, NULLABLE_RESOURCE(port, p_txd_1), rmii_data_pin_assignment_t tx_pin_map,
clock rxclk,
clock txclk,
rmii_port_timing_t port_timing,
Expand Down
2 changes: 1 addition & 1 deletion lib_ethernet/src/mii_ethernet_rt_mac.xc
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ unsafe void mii_ethernet_server(mii_mempool_t rx_mem,
if (speed < 0 || speed >= NUM_ETHERNET_SPEEDS) {
fail("Invalid Ethernet speed, must be a valid ethernet_speed_t enum value");
}
p_port_state->ingress_ts_latency[speed] = value / 10; // div by 10 to get to timer ticks from nanonseconds
p_port_state->ingress_ts_latency[speed] = value / 10; // div by 10 to get to timer ticks from nanonseconds
break;
}

Expand Down
8 changes: 5 additions & 3 deletions lib_ethernet/src/rmii_ethernet_rt_mac.xc
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ void rmii_ethernet_rt_mac(SERVER_INTERFACE(ethernet_cfg_if, i_cfg[n_cfg]), stati
nullable_streaming_chanend_t c_rx_hp,
nullable_streaming_chanend_t c_tx_hp,
in_port_t p_clk,
port p_rxd_0, NULLABLE_RESOURCE(port, p_rxd_1), rmii_data_4b_pin_assignment_t rx_pin_map,
port p_rxd_0, NULLABLE_RESOURCE(port, p_rxd_1), rmii_data_pin_assignment_t rx_pin_map,
in_port_t p_rxdv,
out_port_t p_txen,
port p_txd_0, NULLABLE_RESOURCE(port, p_txd_1), rmii_data_4b_pin_assignment_t tx_pin_map,
port p_txd_0, NULLABLE_RESOURCE(port, p_txd_1), rmii_data_pin_assignment_t tx_pin_map,
clock rxclk,
clock txclk,
rmii_port_timing_t port_timing,
Expand Down Expand Up @@ -130,12 +130,14 @@ void rmii_ethernet_rt_mac(SERVER_INTERFACE(ethernet_cfg_if, i_cfg[n_cfg]), stati
out buffered port:32 * unsafe tx_data_0 = NULL;
out buffered port:32 * unsafe tx_data_1 = NULL;

// Extract port info
unsigned tx_port_width = ((unsigned)(p_txd_0) >> 16) & 0xff;

switch(tx_port_width){
case 8:
case 4:
tx_data_0 = enable_buffered_out_port((unsigned*)(&p_txd_0), 32);
rmii_master_init_tx_4b(p_clk, tx_data_0, p_txen, txclk, port_timing);
rmii_master_init_tx_4b_8b(p_clk, tx_data_0, p_txen, txclk, port_timing);
break;
case 1:
tx_data_0 = enable_buffered_out_port((unsigned*)&p_txd_0, 32);
Expand Down
14 changes: 7 additions & 7 deletions lib_ethernet/src/rmii_master.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ unsafe void rmii_master_init_rx_1b( in port p_clk,
clock rxclk,
rmii_port_timing_t port_timing);

unsafe void rmii_master_init_tx_4b( in port p_clk,
out buffered port:32 * unsafe tx_data,
out port p_txen,
clock txclk,
rmii_port_timing_t port_timing);
unsafe void rmii_master_init_tx_4b_8b( in port p_clk,
out buffered port:32 * unsafe tx_data,
out port p_txen,
clock txclk,
rmii_port_timing_t port_timing);

unsafe void rmii_master_init_tx_1b( in port p_clk,
out buffered port:32 * unsafe tx_data_0,
Expand All @@ -39,7 +39,7 @@ unsafe void rmii_master_rx_pins_4b(mii_mempool_t rx_mem,
unsigned * unsafe rdptr,
in port p_mii_rxdv,
in buffered port:32 * unsafe p_mii_rxd,
rmii_data_4b_pin_assignment_t rx_port_4b_pins,
rmii_data_pin_assignment_t rx_port_4b_pins,
volatile int * unsafe running_flag_ptr,
chanend c_rx_pins_exit);

Expand All @@ -60,7 +60,7 @@ unsafe void rmii_master_tx_pins(mii_mempool_t tx_mem_lp,
unsigned tx_port_width,
out buffered port:32 * unsafe p_mii_txd_0,
out buffered port:32 * unsafe p_mii_txd_1,
rmii_data_4b_pin_assignment_t tx_port_4b_pins,
rmii_data_pin_assignment_t tx_port_pins,
clock txclk,
volatile ethernet_port_state_t * unsafe p_port_state,
volatile int * unsafe running_flag_ptr);
Expand Down
Loading