1 logger -expect-no-warnings
3 module test (a, b, c, y);
8 assign #(12.5, 14.5) y = ^(a ? b : c);
13 logger -expect-no-warnings
15 module test (input [7:0] a, b, c, d, output [7:0] x, y, z);
16 assign #(20, 20, 25) x = a + b, y = b + c, z = c + d;
21 logger -expect-no-warnings
23 module test (a, b, c, y);
24 localparam TIME_STEP = 0.011;
29 assign #(TIME_STEP, TIME_STEP, TIME_STEP) y = (a >> b) >>> c;
34 logger -expect-no-warnings
37 localparam TIME_STEP = 0.7;
39 and #(TIME_STEP, 2) and_gate (o, a, b);
40 wire #(0, TIME_STEP, TIME_STEP) x;
46 logger -expect warning "Yosys has only limited support for tri-state logic at the moment." 1
48 module test (input en, input a, input b, output c);
49 wire [15:0] add0_res = a + b;
50 assign #(3, 3) c = (en) ? a : 1'bz;
55 logger -expect-no-warnings
57 module test (input en, d, t_rise, t_fall);
61 o = #(t_rise, t_fall, 50) ~d;
66 logger -expect-no-warnings
68 module test #(parameter DELAY_RISE = 0, DELAY_FALL = 0, DELAY_Z = 0)
69 (input clock, input reset, input req_0, input req_1, output gnt_0, output gnt_1);
71 parameter IDLE = 3'b001, GNT0 = 3'b010, GNT1 = 3'b100;
73 reg [SIZE-1:0] next_state;
76 always @ (state or req_0 or req_1)
80 IDLE : if (req_0 == 1'b1) begin
81 next_state = #(DELAY_RISE * 2) GNT0;
82 end else if (req_1 == 1'b1) begin
83 next_state = #(DELAY_RISE * 2.5, DELAY_FALL) GNT1;
85 next_state = #(DELAY_RISE * 2.5, DELAY_FALL, DELAY_Z) IDLE;
87 GNT0 : if (req_0 == 1'b1) begin
88 #(DELAY_RISE, DELAY_FALL) next_state = GNT0;
90 #DELAY_RISE next_state = IDLE;
92 GNT1 : if (req_1 == 1'b1) begin
93 #10 next_state = GNT1;
95 #(10) next_state = IDLE;
97 default : next_state = IDLE;
101 always @ (posedge clock)
103 if (reset == 1'b1) begin
106 #(1, 3) state <= next_state;
110 always @ (posedge clock)
112 if (reset == 1'b1) begin
113 gnt_0 <= #(DELAY_RISE, DELAY_FALL, DELAY_Z) 1'b0;
118 gnt_0 <= #(DELAY_RISE, DELAY_FALL, DELAY_Z) 1'b0;
122 gnt_0 <= #(DELAY_RISE, DELAY_FALL) 1'b1;
126 gnt_0 <= #(DELAY_RISE) 1'b0;
140 logger -expect-no-warnings
144 initial #(1,2) q = 1;
149 logger -expect-no-warnings
151 module test #(parameter hyst = 16)
152 (input [0:1] inA, input rst, output reg out);
153 parameter real updatePeriod = 100.0;
155 always #updatePeriod begin
156 if (rst) out <= 1'b0;
157 else if (inA[0] > inA[1]) out <= 1'b1;
158 else if (inA[0] < inA[1] - hyst) out <= 1'b0;
164 logger -expect-no-warnings
166 module test #(parameter hyst = 16)
167 (input [0:1] inA, input rst, output reg out);
168 parameter updatePeriod = (100:125:200);
170 always #updatePeriod begin
171 if (rst) out <= 1'b0;
172 else if (inA[0] > inA[1]) out <= 1'b1;
173 else if (inA[0] < inA[1] - hyst) out <= 1'b0;
179 logger -expect-no-warnings
184 always #(100, 180, 230) clk = ~clk;
189 logger -expect-no-warnings
194 always clk = #(100, 180, 230) ~clk;
196 sig_036_A <= #(2, 4, 5.5) 0;
197 sig_036_B <= #(1.3, 3) 0;
200 sig_036_A <= #(2 : 3 : 5) ~0;
201 sig_036_B <= #(4 : 6 : 6, 10) ~0;
202 sig_036_S <= #(1 : 2 : 3, 2 : 2 : 3, 10) ~0;
209 logger -expect-no-warnings
211 module test (clk, en, i, o);
215 always @ (posedge clk)
218 p <= #(5:15:25, 20, 30) i;
220 #(5, 3:5:8, 10) p <= i;
223 assign #(10, 20, 15:20:30) o = p;