lss: Add some interface configuration checks to I2C modules

Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich
2025-08-02 14:40:56 -07:00
parent 8017534c45
commit 89f60f26ff
2 changed files with 11 additions and 0 deletions

View File

@@ -151,6 +151,13 @@ I/O pin. This would prevent devices from stretching the clock period.
*/ */
// check configuration
if (s_axis_cmd.DATA_W < 12)
$fatal(0, "Command interface width must be at least 12 bits (instance %m)");
if (s_axis_tx.DATA_W != 8 || m_axis_rx.DATA_W != 8)
$fatal(0, "Data interface width must be 8 bits (instance %m)");
localparam [3:0] localparam [3:0]
STATE_IDLE = 4'd0, STATE_IDLE = 4'd0,
STATE_ACTIVE_WRITE = 4'd1, STATE_ACTIVE_WRITE = 4'd1,

View File

@@ -135,6 +135,10 @@ I/O pin. This would prevent devices from stretching the clock period.
*/ */
// check configuration
if (s_axis_tx.DATA_W != 8 || m_axis_rx.DATA_W != 8)
$fatal(0, "Data interface width must be 8 bits (instance %m)");
localparam [2:0] localparam [2:0]
STATE_IDLE = 3'd0, STATE_IDLE = 3'd0,
STATE_ADDRESS = 3'd1, STATE_ADDRESS = 3'd1,