Line 69... |
Line 69... |
|
|
//
|
//
|
// instantiate test data modules
|
// instantiate test data modules
|
//
|
//
|
const_map_2bit cm_2bit();
|
const_map_2bit cm_2bit();
|
|
const_map_3bit cm_3bit();
|
|
const_map_4bit cm_4bit();
|
|
const_map_5bit cm_5bit();
|
|
|
|
|
initial begin
|
initial begin
|
clk = 0;
|
clk = 0;
|
we_fast_data_i = 0;
|
we_fast_data_i = 0;
|
Line 139... |
Line 142... |
|
|
//
|
//
|
// checking the constellation map
|
// checking the constellation map
|
//
|
//
|
check_const_map(2);
|
check_const_map(2);
|
|
check_const_map(3);
|
|
check_const_map(4);
|
|
check_const_map(5);
|
|
|
#1000 $finish();
|
#1000 $finish();
|
|
|
end // main test
|
end // main test
|
|
|
Line 243... |
Line 249... |
// feed input data
|
// feed input data
|
dut.bit_load <= bit;
|
dut.bit_load <= bit;
|
dut.cin <= i;
|
dut.cin <= i;
|
|
|
@ (posedge clk);
|
@ (posedge clk);
|
|
@ (posedge clk);
|
@ (negedge clk);
|
@ (negedge clk);
|
// compare output with expected result
|
// compare output with expected result
|
case (bit)
|
case (bit)
|
1: $display("%d bit is not support constellation size", bit);
|
1: $display("%d bit is not support constellation size", bit);
|
|
|
2: begin
|
2: begin
|
if(cm_2bit.re[i] !== x_o) begin
|
if(cm_2bit.re[i] !== x_o) begin
|
$display("Input: %d --> x_o expected: %d got: %d", i, cm_2bit.re[i], x_o);
|
$display("Input: %d --> x_o expected: %d got: %d", i, cm_2bit.re[i], x_o);
|
end
|
end
|
if(cm_2bit.im[i] !== y_o) begin
|
if(cm_2bit.im[i] !== y_o) begin
|
$display("Input: %d --> y_o expected: %d got: %d", i, cm_2bit.im[i], y_o);
|
$display("Input: %d --> y_o expected: %d got: %d", i, cm_2bit.im[i], y_o);
|
end
|
end
|
end
|
end
|
|
|
|
3: begin
|
|
if(cm_3bit.re[i] !== x_o) begin
|
|
$display("Input: %d --> x_o expected: %d got: %d", i, cm_3bit.re[i], x_o);
|
|
end
|
|
if(cm_3bit.im[i] !== y_o) begin
|
|
$display("Input: %d --> y_o expected: %d got: %d", i, cm_3bit.im[i], y_o);
|
|
end
|
|
end
|
|
|
|
4: begin
|
|
if(cm_4bit.re[i] !== x_o) begin
|
|
$display("Input: %d --> x_o expected: %d got: %d", i, cm_4bit.re[i], x_o);
|
|
end
|
|
if(cm_4bit.im[i] !== y_o) begin
|
|
$display("Input: %d --> y_o expected: %d got: %d", i, cm_4bit.im[i], y_o);
|
|
end
|
|
end
|
|
|
|
5: begin
|
|
if(cm_5bit.re[i] !== x_o) begin
|
|
$display($time, " Input: %d --> x_o expected: %d got: %d", i, cm_5bit.re[i], x_o);
|
|
end
|
|
if(cm_5bit.im[i] !== y_o) begin
|
|
$display($time, " Input: %d --> y_o expected: %d got: %d", i, cm_5bit.im[i], y_o);
|
|
end
|
|
end
|
|
|
|
|
default: $display("%d is not an implemented bit size", bit);
|
default: $display("%d is not an implemented bit size", bit);
|
endcase
|
endcase
|
|
|
end
|
end
|
|
|