Skip to content

Commit

Permalink
renamed translate_off to `ifndef SYNTHESIS
Browse files Browse the repository at this point in the history
  • Loading branch information
sifferman committed Jan 21, 2024
1 parent 69d40a5 commit b549254
Show file tree
Hide file tree
Showing 32 changed files with 70 additions and 70 deletions.
4 changes: 2 additions & 2 deletions src/addr_decode_dync.sv
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ module addr_decode_dync #(
// Assumptions and assertions
`ifndef COMMON_CELLS_ASSERTS_OFF
`ifndef XSIM
// pragma translate_off
`ifndef SYNTHESIS
initial begin : proc_check_parameters
assume ($bits(addr_i) == $bits(addr_map_i[0].start_addr)) else
$warning($sformatf("Input address has %d bits and address map has %d bits.",
Expand Down Expand Up @@ -184,7 +184,7 @@ module addr_decode_dync #(
end
end
end
// pragma translate_on
`endif
`endif
`endif

Expand Down
4 changes: 2 additions & 2 deletions src/cb_filter.sv
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ module hash_block #(

`ifndef COMMON_CELLS_ASSERTS_OFF
// assertions
// pragma translate_off
`ifndef SYNTHESIS
initial begin
hash_conf: assume (InpWidth > HashWidth) else
$fatal(1, "%m:\nA Hash Function reduces the width of the input>\nInpWidth: %s\nOUT_WIDTH: %s",
InpWidth, HashWidth);
end
// pragma translate_on
`endif
`endif
endmodule
4 changes: 2 additions & 2 deletions src/cdc_2phase_clearable.sv
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ module cdc_2phase_src_clearable #(

// Assertions
`ifndef COMMON_CELLS_ASSERTS_OFF
// pragma translate_off
`ifndef SYNTHESIS
no_clear_and_request: assume property (
@(posedge clk_i) disable iff(~rst_ni) (clear_i |-> ~valid_i))
else $fatal(1, "No request allowed while clear_i is asserted.");

// pragma translate_on
`endif
`endif

endmodule
Expand Down
4 changes: 2 additions & 2 deletions src/cdc_fifo_2phase.sv
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ module cdc_fifo_2phase #(
);

// Check the invariants.
//pragma translate_off
`ifndef SYNTHESIS
initial begin
assert(LOG_DEPTH > 0);
end
//pragma translate_on
`endif

localparam int PtrWidth = LOG_DEPTH+1;
typedef logic [PtrWidth-1:0] pointer_t;
Expand Down
4 changes: 2 additions & 2 deletions src/cdc_fifo_gray.sv
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ module cdc_fifo_gray #(
);

// Check the invariants.
// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
initial assert(LOG_DEPTH > 0);
initial assert(SYNC_STAGES >= 2);
`endif
// pragma translate_on
`endif

endmodule

Expand Down
4 changes: 2 additions & 2 deletions src/cdc_fifo_gray_clearable.sv
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,12 @@ module cdc_fifo_gray_clearable #(
assign dst_clear_pending_o = s_dst_isolate_req;

// Check the invariants.
// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
initial assert(LOG_DEPTH > 0);
initial assert(SYNC_STAGES >= 2);
`endif
// pragma translate_on
`endif

endmodule

Expand Down
4 changes: 2 additions & 2 deletions src/cf_math_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package cf_math_pkg;
function automatic integer ceil_div (input longint dividend, input longint divisor);
automatic longint remainder;

// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
if (dividend < 0) begin
$fatal(1, "Dividend %0d is not a natural number!", dividend);
Expand All @@ -37,7 +37,7 @@ package cf_math_pkg;
$fatal(1, "Division by zero!");
end
`endif
// pragma translate_on
`endif

remainder = dividend;
for (ceil_div = 0; remainder > 0; ceil_div++) begin
Expand Down
4 changes: 2 additions & 2 deletions src/exp_backoff.sv
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module exp_backoff #(
// assertions
///////////////////////////////////////////////////////

//pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
initial begin
// assert wrong parameterizations
Expand All @@ -93,6 +93,6 @@ module exp_backoff #(
else $fatal(1,"Zero seed is not allowed for LFSR");
end
`endif
//pragma translate_on
`endif

endmodule // exp_backoff
4 changes: 2 additions & 2 deletions src/fifo_v3.sv
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ module fifo_v3 #(
end
end

// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
initial begin
assert (DEPTH > 0) else $error("DEPTH must be greater than 0.");
Expand All @@ -151,6 +151,6 @@ module fifo_v3 #(
@(posedge clk_i) disable iff (~rst_ni) (empty_o |-> ~pop_i))
else $fatal (1, "Trying to pop data although the FIFO is empty.");
`endif
// pragma translate_on
`endif

endmodule // fifo_v3
4 changes: 2 additions & 2 deletions src/id_queue.sv
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ module id_queue #(
end

// Validate parameters.
// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
initial begin: validate_params
assert (ID_WIDTH >= 1)
Expand All @@ -413,6 +413,6 @@ module id_queue #(
else $fatal(1, "The queue must have capacity of at least one entry!");
end
`endif
// pragma translate_on
`endif

endmodule
4 changes: 2 additions & 2 deletions src/isochronous_4phase_handshake.sv
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ module isochronous_4phase_handshake (
// destination is valid if we didn't yet get acknowledge
assign dst_valid_o = (dst_req_q != dst_ack_q);

// pragma translate_off
`ifndef SYNTHESIS
// stability guarantees
`ifndef COMMON_CELLS_ASSERTS_OFF
assert property (@(posedge src_clk_i) disable iff (~src_rst_ni)
(src_valid_i && !src_ready_o |=> $stable(src_valid_i))) else $error("src_valid_i is unstable");
assert property (@(posedge dst_clk_i) disable iff (~dst_rst_ni)
(dst_valid_o && !dst_ready_i |=> $stable(dst_valid_o))) else $error("dst_valid_o is unstable");
`endif
// pragma translate_on
`endif

endmodule
4 changes: 2 additions & 2 deletions src/isochronous_spill_register.sv
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module isochronous_spill_register #(
assign dst_data_o = mem_q[rd_pointer_q[0]];
end

// pragma translate_off
`ifndef SYNTHESIS
// stability guarantees
`ifndef COMMON_CELLS_ASSERTS_OFF
assert property (@(posedge src_clk_i) disable iff (~src_rst_ni)
Expand All @@ -107,5 +107,5 @@ module isochronous_spill_register #(
assert property (@(posedge dst_clk_i) disable iff (~dst_rst_ni)
(dst_valid_o && !dst_ready_i |=> $stable(dst_data_o))) else $error("dst_data_o is unstable");
`endif
// pragma translate_on
`endif
endmodule
4 changes: 2 additions & 2 deletions src/lfsr.sv
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ end
// assertions
////////////////////////////////////////////////////////////////////////
`ifndef COMMON_CELLS_ASSERTS_OFF
// pragma translate_off
`ifndef SYNTHESIS
initial begin
// these are the LUT limits
assert(OutWidth <= LfsrWidth) else
Expand All @@ -308,7 +308,7 @@ end
all_zero: assert property (
@(posedge clk_i) disable iff (!rst_ni) en_i |-> lfsr_d)
else $fatal(1,"Lfsr must not be all-zero.");
// pragma translate_on
`endif
`endif

endmodule // lfsr
4 changes: 2 additions & 2 deletions src/lfsr_16bit.sv
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ module lfsr_16bit #(
end

`ifndef COMMON_CELLS_ASSERTS_OFF
//pragma translate_off
`ifndef SYNTHESIS
initial begin
assert (WIDTH <= 16)
else $fatal(1, "WIDTH needs to be less than 16 because of the 16-bit LFSR");
end
//pragma translate_on
`endif
`endif

endmodule
4 changes: 2 additions & 2 deletions src/lfsr_8bit.sv
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ module lfsr_8bit #(
end

`ifndef COMMON_CELLS_ASSERTS_OFF
//pragma translate_off
`ifndef SYNTHESIS
initial begin
assert (WIDTH <= 8) else $fatal(1, "WIDTH needs to be less than 8 because of the 8-bit LFSR");
end
//pragma translate_on
`endif
`endif

endmodule
8 changes: 4 additions & 4 deletions src/lzc.sv
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ module lzc #(
localparam int unsigned NumLevels = $clog2(WIDTH);

`ifndef COMMON_CELLS_ASSERTS_OFF
// pragma translate_off
`ifndef SYNTHESIS
initial begin
assert(WIDTH > 0) else $fatal(1, "input must be at least one bit wide");
end
// pragma translate_on
`endif
`endif

logic [WIDTH-1:0][NumLevels-1:0] index_lut;
Expand Down Expand Up @@ -101,13 +101,13 @@ module lzc #(

end : gen_lzc

// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
initial begin: validate_params
assert (WIDTH >= 1)
else $fatal(1, "The WIDTH must at least be one bit wide!");
end
`endif
// pragma translate_on
`endif

endmodule : lzc
4 changes: 2 additions & 2 deletions src/mem_to_banks_detailed.sv
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module mem_to_banks_detailed #(
assign rvalid_o = &(resp_valid | dead_response);

// Assertions
// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
`ifndef SYNTHESIS
initial begin
Expand All @@ -221,5 +221,5 @@ module mem_to_banks_detailed #(
end
`endif
`endif
// pragma translate_on
`endif
endmodule
4 changes: 2 additions & 2 deletions src/multiaddr_decode.sv
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ module multiaddr_decode #(
// Assumptions and assertions
`ifndef COMMON_CELLS_ASSERTS_OFF
`ifndef XSIM
// pragma translate_off
`ifndef SYNTHESIS
initial begin : proc_check_parameters
assume (NoRules > 0) else
$fatal(1, $sformatf("At least one rule needed"));
Expand All @@ -148,7 +148,7 @@ module multiaddr_decode #(
end
end

// pragma translate_on
`endif
`endif
`endif
endmodule
4 changes: 2 additions & 2 deletions src/onehot_to_bin.sv
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ module onehot_to_bin #(
assign bin[j] = |(tmp_mask & onehot);
end

// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
assert final ($onehot0(onehot)) else
$fatal(1, "[onehot_to_bin] More than two bit set in the one-hot signal");
`endif
// pragma translate_on
`endif
endmodule
4 changes: 2 additions & 2 deletions src/plru_tree.sv
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module plru_tree #(
end
end

// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
initial begin
assert (ENTRIES == 2**LogEntries) else $error("Entries must be a power of two");
Expand All @@ -128,6 +128,6 @@ module plru_tree #(
@(posedge clk_i) disable iff (~rst_ni) ($onehot0(plru_o)))
else $fatal (1, "More than one bit set in PLRU output.");
`endif
// pragma translate_on
`endif

endmodule
12 changes: 6 additions & 6 deletions src/rr_arb_tree.sv
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module rr_arb_tree #(
output idx_t idx_o
);

// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
`ifndef VERILATOR
`ifndef XSIM
Expand All @@ -118,7 +118,7 @@ module rr_arb_tree #(
`endif
`endif
`endif
// pragma translate_on
`endif

// just pass through in this corner case
if (NumIn == unsigned'(1)) begin : gen_pass_through
Expand Down Expand Up @@ -170,7 +170,7 @@ module rr_arb_tree #(
end
end

// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
lock: assert property(
@(posedge clk_i) disable iff (!rst_ni || flush_i)
Expand All @@ -186,7 +186,7 @@ module rr_arb_tree #(
$fatal (1, "It is disallowed to deassert unserved request signals when LockIn is \
enabled.");
`endif
// pragma translate_on
`endif

always_ff @(posedge clk_i or negedge rst_ni) begin : p_req_regs
if (!rst_ni) begin
Expand Down Expand Up @@ -310,7 +310,7 @@ module rr_arb_tree #(
end
end

// pragma translate_off
`ifndef SYNTHESIS
`ifndef COMMON_CELLS_ASSERTS_OFF
`ifndef XSIM
initial begin : p_assert
Expand Down Expand Up @@ -345,7 +345,7 @@ module rr_arb_tree #(
else $fatal (1, "Req out implies req in.");
`endif
`endif
// pragma translate_on
`endif
end

endmodule : rr_arb_tree
Loading

0 comments on commit b549254

Please sign in to comment.