From ce00df8de150072ed95cef8fb2b6061beb87bfc8 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Thu, 25 Jul 2019 16:30:10 -0700 Subject: [PATCH] Include instance names in error messages --- rtl/axis_adapter.v | 6 +++--- rtl/axis_async_fifo.v | 8 ++++---- rtl/axis_async_fifo_adapter.v | 6 +++--- rtl/axis_fifo.v | 8 ++++---- rtl/axis_fifo_adapter.v | 6 +++--- rtl/axis_frame_length_adjust.v | 2 +- rtl/axis_switch.v | 8 ++++---- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/rtl/axis_adapter.v b/rtl/axis_adapter.v index 065ab9f9c..68b31a508 100644 --- a/rtl/axis_adapter.v +++ b/rtl/axis_adapter.v @@ -109,17 +109,17 @@ parameter SEGMENT_KEEP_WIDTH = KEEP_WIDTH / SEGMENT_COUNT; // bus width assertions initial begin if (S_DATA_WORD_SIZE * S_KEEP_WIDTH_INT != S_DATA_WIDTH) begin - $error("Error: input data width not evenly divisble"); + $error("Error: input data width not evenly divisble (instance %m)"); $finish; end if (M_DATA_WORD_SIZE * M_KEEP_WIDTH_INT != M_DATA_WIDTH) begin - $error("Error: output data width not evenly divisble"); + $error("Error: output data width not evenly divisble (instance %m)"); $finish; end if (S_DATA_WORD_SIZE != M_DATA_WORD_SIZE) begin - $error("Error: word size mismatch"); + $error("Error: word size mismatch (instance %m)"); $finish; end end diff --git a/rtl/axis_async_fifo.v b/rtl/axis_async_fifo.v index a3568b78d..416cc09ca 100644 --- a/rtl/axis_async_fifo.v +++ b/rtl/axis_async_fifo.v @@ -120,22 +120,22 @@ parameter ADDR_WIDTH = (KEEP_ENABLE && KEEP_WIDTH > 1) ? $clog2(DEPTH/KEEP_WIDTH // check configuration initial begin if (FRAME_FIFO && !LAST_ENABLE) begin - $error("Error: FRAME_FIFO set requires LAST_ENABLE set"); + $error("Error: FRAME_FIFO set requires LAST_ENABLE set (instance %m)"); $finish; end if (DROP_BAD_FRAME && !FRAME_FIFO) begin - $error("Error: DROP_BAD_FRAME set requires FRAME_FIFO set"); + $error("Error: DROP_BAD_FRAME set requires FRAME_FIFO set (instance %m)"); $finish; end if (DROP_WHEN_FULL && !FRAME_FIFO) begin - $error("Error: DROP_WHEN_FULL set requires FRAME_FIFO set"); + $error("Error: DROP_WHEN_FULL set requires FRAME_FIFO set (instance %m)"); $finish; end if (DROP_BAD_FRAME && (USER_BAD_FRAME_MASK & {USER_WIDTH{1'b1}}) == 0) begin - $error("Error: Invalid USER_BAD_FRAME_MASK value"); + $error("Error: Invalid USER_BAD_FRAME_MASK value (instance %m)"); $finish; end end diff --git a/rtl/axis_async_fifo_adapter.v b/rtl/axis_async_fifo_adapter.v index d87e81083..a22f1cae6 100644 --- a/rtl/axis_async_fifo_adapter.v +++ b/rtl/axis_async_fifo_adapter.v @@ -133,17 +133,17 @@ parameter KEEP_WIDTH = EXPAND_BUS ? M_KEEP_WIDTH_INT : S_KEEP_WIDTH_INT; // bus width assertions initial begin if (S_DATA_WORD_SIZE * S_KEEP_WIDTH_INT != S_DATA_WIDTH) begin - $error("Error: input data width not evenly divisble"); + $error("Error: input data width not evenly divisble (instance %m)"); $finish; end if (M_DATA_WORD_SIZE * M_KEEP_WIDTH_INT != M_DATA_WIDTH) begin - $error("Error: output data width not evenly divisble"); + $error("Error: output data width not evenly divisble (instance %m)"); $finish; end if (S_DATA_WORD_SIZE != M_DATA_WORD_SIZE) begin - $error("Error: word size mismatch"); + $error("Error: word size mismatch (instance %m)"); $finish; end end diff --git a/rtl/axis_fifo.v b/rtl/axis_fifo.v index 605fc1921..d3b19adfd 100644 --- a/rtl/axis_fifo.v +++ b/rtl/axis_fifo.v @@ -113,22 +113,22 @@ parameter ADDR_WIDTH = (KEEP_ENABLE && KEEP_WIDTH > 1) ? $clog2(DEPTH/KEEP_WIDTH // check configuration initial begin if (FRAME_FIFO && !LAST_ENABLE) begin - $error("Error: FRAME_FIFO set requires LAST_ENABLE set"); + $error("Error: FRAME_FIFO set requires LAST_ENABLE set (instance %m)"); $finish; end if (DROP_BAD_FRAME && !FRAME_FIFO) begin - $error("Error: DROP_BAD_FRAME set requires FRAME_FIFO set"); + $error("Error: DROP_BAD_FRAME set requires FRAME_FIFO set (instance %m)"); $finish; end if (DROP_WHEN_FULL && !FRAME_FIFO) begin - $error("Error: DROP_WHEN_FULL set requires FRAME_FIFO set"); + $error("Error: DROP_WHEN_FULL set requires FRAME_FIFO set (instance %m)"); $finish; end if (DROP_BAD_FRAME && (USER_BAD_FRAME_MASK & {USER_WIDTH{1'b1}}) == 0) begin - $error("Error: Invalid USER_BAD_FRAME_MASK value"); + $error("Error: Invalid USER_BAD_FRAME_MASK value (instance %m)"); $finish; end end diff --git a/rtl/axis_fifo_adapter.v b/rtl/axis_fifo_adapter.v index ae97f78fc..94c390c96 100644 --- a/rtl/axis_fifo_adapter.v +++ b/rtl/axis_fifo_adapter.v @@ -129,17 +129,17 @@ parameter KEEP_WIDTH = EXPAND_BUS ? M_KEEP_WIDTH_INT : S_KEEP_WIDTH_INT; // bus width assertions initial begin if (S_DATA_WORD_SIZE * S_KEEP_WIDTH_INT != S_DATA_WIDTH) begin - $error("Error: input data width not evenly divisble"); + $error("Error: input data width not evenly divisble (instance %m)"); $finish; end if (M_DATA_WORD_SIZE * M_KEEP_WIDTH_INT != M_DATA_WIDTH) begin - $error("Error: output data width not evenly divisble"); + $error("Error: output data width not evenly divisble (instance %m)"); $finish; end if (S_DATA_WORD_SIZE != M_DATA_WORD_SIZE) begin - $error("Error: word size mismatch"); + $error("Error: word size mismatch (instance %m)"); $finish; end end diff --git a/rtl/axis_frame_length_adjust.v b/rtl/axis_frame_length_adjust.v index b7c216430..55257cb1d 100644 --- a/rtl/axis_frame_length_adjust.v +++ b/rtl/axis_frame_length_adjust.v @@ -102,7 +102,7 @@ localparam DATA_WORD_WIDTH = DATA_WIDTH / KEEP_WIDTH; // bus width assertions initial begin if (DATA_WORD_WIDTH * KEEP_WIDTH != DATA_WIDTH) begin - $error("Error: data width not evenly divisble"); + $error("Error: data width not evenly divisble (instance %m)"); $finish; end end diff --git a/rtl/axis_switch.v b/rtl/axis_switch.v index 5352fe221..0e785851e 100644 --- a/rtl/axis_switch.v +++ b/rtl/axis_switch.v @@ -113,7 +113,7 @@ integer i, j; // check configuration initial begin if (DEST_WIDTH < CL_M_COUNT) begin - $error("Error: DEST_WIDTH too small for port count"); + $error("Error: DEST_WIDTH too small for port count (instance %m)"); $finish; end @@ -126,7 +126,7 @@ initial begin if (M_BASE[i*DEST_WIDTH +: DEST_WIDTH] == M_BASE[j*DEST_WIDTH +: DEST_WIDTH]) begin $display("%d: %08x", i, M_BASE[i*DEST_WIDTH +: DEST_WIDTH]); $display("%d: %08x", j, M_BASE[j*DEST_WIDTH +: DEST_WIDTH]); - $error("Error: ranges overlap"); + $error("Error: ranges overlap (instance %m)"); $finish; end end @@ -134,7 +134,7 @@ initial begin end else begin for (i = 0; i < M_COUNT; i = i + 1) begin if (M_BASE[i*DEST_WIDTH +: DEST_WIDTH] > M_TOP[i*DEST_WIDTH +: DEST_WIDTH]) begin - $error("Error: invalid range"); + $error("Error: invalid range (instance %m)"); $finish; end end @@ -144,7 +144,7 @@ initial begin if (M_BASE[i*DEST_WIDTH +: DEST_WIDTH] <= M_TOP[j*DEST_WIDTH +: DEST_WIDTH] && M_BASE[j*DEST_WIDTH +: DEST_WIDTH] <= M_TOP[i*DEST_WIDTH +: DEST_WIDTH]) begin $display("%d: %08x-%08x", i, M_BASE[i*DEST_WIDTH +: DEST_WIDTH], M_TOP[i*DEST_WIDTH +: DEST_WIDTH]); $display("%d: %08x-%08x", j, M_BASE[j*DEST_WIDTH +: DEST_WIDTH], M_TOP[j*DEST_WIDTH +: DEST_WIDTH]); - $error("Error: ranges overlap"); + $error("Error: ranges overlap (instance %m)"); $finish; end end