data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v
1: b'%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:37: Unsupported or unknown PLI call: $dumpfile\n   initial $dumpfile("hb_tb.vcd");\n           ^~~~~~~~~\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:38: Unsupported or unknown PLI call: $dumpvars\n   initial $dumpvars(0,hb_tb);\n           ^~~~~~~~~\n%Warning-STMTDLY: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:40: Unsupported: Ignoring delay on this delayed statement.\n   always #5 clk <= ~clk;\n          ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:43: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:71: syntax error, unexpected \'@\'\n @(negedge rst);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:76: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:78: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:80: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:82: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:84: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:86: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:88: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:90: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:94: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:96: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:98: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:100: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:102: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:104: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:106: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:108: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:110: syntax error, unexpected \'@\'\n @(posedge clk);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:118: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:122: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:124: syntax error, unexpected \'@\'\n @(posedge strobe_in);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:127: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:130: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:133: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:136: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:139: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:143: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:145: syntax error, unexpected \'@\'\n @(posedge strobe_in);\n ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:148: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:151: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:154: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:157: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: data/full_repos/permissive/447976230/fpga/usrp2/sdr_lib/hb_tb.v:160: syntax error, unexpected \'@\'\n   @(posedge strobe_in);\n   ^\n%Error: Exiting due to 36 error(s), 1 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module hb_tb();

   localparam SWIDTH = 17;
   localparam CWIDTH = 18;
   localparam TWIDTH = 20;
   localparam ACC_WIDTH = 40;
   
   reg clk = 0, rst = 1;
   wire strobe_in, strobe_out;
   reg [SWIDTH-1:0] sample_in;
   wire signed [SWIDTH:0] sample_out;

   reg 	       set_stb;
   reg [7:0]   set_addr;
   reg [31:0]  set_data;

   localparam  DECIM = 3;
   
   initial $dumpfile("hb_tb.vcd");
   initial $dumpvars(0,hb_tb);

   always #5 clk <= ~clk;
   initial 
     begin
	@(posedge clk);
	@(negedge clk);
	rst <= 0;
     end

   reg [7:0] stb_counter;
   always @(posedge clk)
     if(rst)
       stb_counter <= 0;
     else
       if(stb_counter == 0)
	 stb_counter <= DECIM;
       else
	 stb_counter <= stb_counter - 1;
   assign    strobe_in = (stb_counter == 0);
   
   hb_decim #(.SWIDTH(SWIDTH),.CWIDTH(CWIDTH),
	      .TWIDTH(TWIDTH),.ACC_WIDTH(ACC_WIDTH)) hb_decim
     (.clk(clk), .rst(rst),
      .set_stb(set_stb), .set_addr(set_addr), .set_data(set_data),
      .sample_in(sample_in),
      .strobe_in(strobe_in),
      .sample_out(sample_out),
      .strobe_out(strobe_out)
      );

   initial
     begin : load_coeffs
	@(negedge rst);
	@(posedge clk);
	set_addr <= 124;
	set_stb <= 1;
	set_data <= -18'd49;
	@(posedge clk);
	set_data <= 18'd165;
	@(posedge clk);
	set_data <= -18'd412;
	@(posedge clk);
	set_data <= 18'd873;
	@(posedge clk);
	set_data <= -18'd1681;
	@(posedge clk);
	set_data <= 18'd3135;
	@(posedge clk);
	set_data <= -18'd6282;
	@(posedge clk);
	set_data <= 18'd20628;
	@(posedge clk);
	set_addr <=125;

	set_data <= {1'b1,1'b1,1'b0,1'b1,4'd15,4'd15,4'd0,4'd0};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd14,4'd1,4'd1};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd13,4'd2,4'd2};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd12,4'd3,4'd3};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd11,4'd4,4'd4};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd10,4'd5,4'd5};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd9,4'd6,4'd6};
	@(posedge clk);
	set_data <= {1'b0,1'b0,1'b1,1'b0,4'd15,4'd8,4'd7,4'd7};
	@(posedge clk);
	set_data <= {1'b0,1'b0,1'b0,1'b0,4'd15,4'd8,4'd7,4'd7};
	@(posedge clk);
	set_stb <= 0;
     end
   
   initial
     begin
	sample_in <= 0;
	repeat(40)
	  @(posedge strobe_in);
	$display("EVEN");
	sample_in <= 0;
	repeat(10)
	  @(posedge strobe_in);
	sample_in <= 1;
	@(posedge strobe_in);
	sample_in <= 0;
	repeat(40)
	  @(posedge strobe_in);
	sample_in <= 1;
	repeat(40)
	  @(posedge strobe_in);
	sample_in <= 0;
	repeat(60)
	  @(posedge strobe_in);
	sample_in <= 1;
	repeat(2)
	  @(posedge strobe_in);
	sample_in <= 0;
	repeat(60)
	  @(posedge strobe_in);
	$display("ODD");
	sample_in <= 0;
	repeat(10)
	  @(posedge strobe_in);
	sample_in <= 1;
	@(posedge strobe_in);
	sample_in <= 0;
	repeat(40)
	  @(posedge strobe_in);
	sample_in <= 1;
	repeat(40)
	  @(posedge strobe_in);
	sample_in <= 0;
	repeat(60)
	  @(posedge strobe_in);
	sample_in <= 1;
	repeat(2)
	  @(posedge strobe_in);
	sample_in <= 0;
	repeat(60)
	  @(posedge strobe_in);
	$finish;
     end

   always @(posedge clk)
     if(strobe_in)
       $display(sample_in);
   
      always @(posedge clk)
	if(strobe_out)
	  $display("\t",sample_out);

endmodule
module hb_tb();


   localparam SWIDTH = 17;
   localparam CWIDTH = 18;
   localparam TWIDTH = 20;
   localparam ACC_WIDTH = 40;
   
   reg clk = 0, rst = 1;
   wire strobe_in, strobe_out;
   reg [SWIDTH-1:0] sample_in;
   wire signed [SWIDTH:0] sample_out;

   reg 	       set_stb;
   reg [7:0]   set_addr;
   reg [31:0]  set_data;

   localparam  DECIM = 3;
   
   initial $dumpfile("hb_tb.vcd");
   initial $dumpvars(0,hb_tb);

   always #5 clk <= ~clk;
   initial 
     begin
	@(posedge clk);
	@(negedge clk);
	rst <= 0;
     end

   reg [7:0] stb_counter;
   always @(posedge clk)
     if(rst)
       stb_counter <= 0;
     else
       if(stb_counter == 0)
	 stb_counter <= DECIM;
       else
	 stb_counter <= stb_counter - 1;
   assign    strobe_in = (stb_counter == 0);
   
   hb_decim #(.SWIDTH(SWIDTH),.CWIDTH(CWIDTH),
	      .TWIDTH(TWIDTH),.ACC_WIDTH(ACC_WIDTH)) hb_decim
     (.clk(clk), .rst(rst),
      .set_stb(set_stb), .set_addr(set_addr), .set_data(set_data),
      .sample_in(sample_in),
      .strobe_in(strobe_in),
      .sample_out(sample_out),
      .strobe_out(strobe_out)
      );

   initial
     begin : load_coeffs
	@(negedge rst);
	@(posedge clk);
	set_addr <= 124;
	set_stb <= 1;
	set_data <= -18'd49;
	@(posedge clk);
	set_data <= 18'd165;
	@(posedge clk);
	set_data <= -18'd412;
	@(posedge clk);
	set_data <= 18'd873;
	@(posedge clk);
	set_data <= -18'd1681;
	@(posedge clk);
	set_data <= 18'd3135;
	@(posedge clk);
	set_data <= -18'd6282;
	@(posedge clk);
	set_data <= 18'd20628;
	@(posedge clk);
	set_addr <=125;

	set_data <= {1'b1,1'b1,1'b0,1'b1,4'd15,4'd15,4'd0,4'd0};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd14,4'd1,4'd1};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd13,4'd2,4'd2};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd12,4'd3,4'd3};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd11,4'd4,4'd4};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd10,4'd5,4'd5};
	@(posedge clk);
	set_data <= {1'b0,1'b1,1'b0,1'b0,4'd15,4'd9,4'd6,4'd6};
	@(posedge clk);
	set_data <= {1'b0,1'b0,1'b1,1'b0,4'd15,4'd8,4'd7,4'd7};
	@(posedge clk);
	set_data <= {1'b0,1'b0,1'b0,1'b0,4'd15,4'd8,4'd7,4'd7};
	@(posedge clk);
	set_stb <= 0;
     end
   
   initial
     begin
	sample_in <= 0;
	repeat(40)
	  @(posedge strobe_in);
	$display("EVEN");
	sample_in <= 0;
	repeat(10)
	  @(posedge strobe_in);
	sample_in <= 1;
	@(posedge strobe_in);
	sample_in <= 0;
	repeat(40)
	  @(posedge strobe_in);
	sample_in <= 1;
	repeat(40)
	  @(posedge strobe_in);
	sample_in <= 0;
	repeat(60)
	  @(posedge strobe_in);
	sample_in <= 1;
	repeat(2)
	  @(posedge strobe_in);
	sample_in <= 0;
	repeat(60)
	  @(posedge strobe_in);
	$display("ODD");
	sample_in <= 0;
	repeat(10)
	  @(posedge strobe_in);
	sample_in <= 1;
	@(posedge strobe_in);
	sample_in <= 0;
	repeat(40)
	  @(posedge strobe_in);
	sample_in <= 1;
	repeat(40)
	  @(posedge strobe_in);
	sample_in <= 0;
	repeat(60)
	  @(posedge strobe_in);
	sample_in <= 1;
	repeat(2)
	  @(posedge strobe_in);
	sample_in <= 0;
	repeat(60)
	  @(posedge strobe_in);
	$finish;
     end

   always @(posedge clk)
     if(strobe_in)
       $display(sample_in);
   
      always @(posedge clk)
	if(strobe_out)
	  $display("\t",sample_out);

endmodule