|
Message
From: cvs at opencores.org<cvs@o...>
Date: Fri Jul 27 04:15:11 CEST 2007
Subject: [cvs-checkins] MODIFIED: dmt_tx ...
Date: 00/07/07 27:04:15 Modified: dmt_tx/const_encoder/tb const_map_data.v tb_const_enc.v Log: Added tests for constellation maps up to 5-bit. Revision Changes Path 1.2 dmt_tx/const_encoder/tb/const_map_data.v http://www.opencores.org/cvsweb.shtml/dmt_tx/const_encoder/tb/const_map_data.v.diff?r1=1.1&r2=1.2 (In the diff below, changes in quantity of whitespace are not shown.) Index: const_map_data.v =================================================================== RCS file: /cvsroot/dannori/dmt_tx/const_encoder/tb/const_map_data.v,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- const_map_data.v 26 Jul 2007 16:57:43 -0000 1.1 +++ const_map_data.v 27 Jul 2007 02:15:11 -0000 1.2 @@ -1,4 +1,9 @@ +// /////////////////////////////////////////////////////////////////// +// +// 2 -bit constellation map +// +// /////////////////////////////////////////////////////////////////// module const_map_2bit; `include "parameters.vh" @@ -14,5 +19,115 @@ re[3] = -1; im[3] = -1; end +endmodule + + +// /////////////////////////////////////////////////////////////////// +// +// 3 -bit constellation map +// +// /////////////////////////////////////////////////////////////////// +module const_map_3bit; + +`include "parameters.vh" + +reg signed [CONSTW-1:0] re [0:7]; +reg signed [CONSTW-1:0] im [0:7]; + + +initial begin + re[0] = 1; im[0] = 1; + re[1] = 1; im[1] = -1; + re[2] = -1; im[2] = 1; + re[3] = -1; im[3] = -1; + re[4] = -3; im[4] = 1; + re[5] = 1; im[5] = 3; + re[6] = -1; im[6] = -3; + re[7] = 3; im[7] = -1; +end + +endmodule + +// /////////////////////////////////////////////////////////////////// +// +// 4 -bit constellation map +// +// /////////////////////////////////////////////////////////////////// +module const_map_4bit; + +`include "parameters.vh" + +reg signed [CONSTW-1:0] re [0:15]; +reg signed [CONSTW-1:0] im [0:15]; + + +initial begin + re[0] = 1; im[0] = 1; + re[1] = 1; im[1] = 3; + re[2] = 3; im[2] = 1; + re[3] = 3; im[3] = 3; + re[4] = 1; im[4] = -3; + re[5] = 1; im[5] = -1; + re[6] = 3; im[6] = -3; + re[7] = 3; im[7] = -1; + re[8] = -3; im[8] = 1; + re[9] = -3; im[9] = 3; + re[10] = -1; im[10] = 1; + re[11] = -1; im[11] = 3; + re[12] = -3; im[12] = -3; + re[13] = -3; im[13] = -1; + re[14] = -1; im[14] = -3; + re[15] = -1; im[15] = -1; +end + +endmodule + +// /////////////////////////////////////////////////////////////////// +//
+// 5 -bit constellation map
+//
+// ///////////////////////////////////////////////////////////////////
+module const_map_5bit;
+
+`include "parameters.vh"
+
+reg signed [CONSTW-1:0] re [0:31];
+reg signed [CONSTW-1:0] im [0:31];
+
+
+initial begin
+ re[0] = 1; im[0] = 1;
+ re[1] = 1; im[1] = 3;
+ re[2] = 3; im[2] = 1;
+ re[3] = 3; im[3] = 3;
+ re[4] = 1; im[4] = -3;
+ re[5] = 1; im[5] = -1;
+ re[6] = 3; im[6] = -3;
+ re[7] = 3; im[7] = -1;
+ re[8] = -3; im[8] = 1;
+ re[9] = -3; im[9] = 3;
+ re[10] = -1; im[10] = 1;
+ re[11] = -1; im[11] = 3;
+ re[12] = -3; im[12] = -3;
+ re[13] = -3; im[13] = -1;
+ re[14] = -1; im[14] = -3;
+ re[15] = -1; im[15] = -1;
+ re[16] = 5; im[16] = 1;
+ re[17] = 5; im[17] = 3;
+ re[18] = -5; im[18] = 1;
+ re[19] = -5; im[19] = 3;
+ re[20] = 1; im[20] = 5;
+ re[21] = 1; im[21] = -5;
+ re[22] = 3; im[22] = 5;
+ re[23] = 3; im[23] = -5;
+ re[24] = -3; im[24] = 5;
+ re[25] = -3; im[25] = -5;
+ re[26] = -1; im[26] = 5;
+ re[27] = -1; im[27] = -5;
+ re[28] = 5; im[28] = -3;
+ re[29] = 5; im[29] = -1;
+ re[30] = -5; im[30] = -3;
+ re[31] = -5; im[31] = -1;
+end
endmodule
1.5 dmt_tx/const_encoder/tb/tb_const_enc.v
http://www.opencores.org/cvsweb.shtml/dmt_tx/const_encoder/tb/tb_const_enc.v.diff?r1=1.4&r2=1.5
(In the diff below, changes in quantity of whitespace are not shown.)
Index: tb_const_enc.v
===================================================================
RCS file: /cvsroot/dannori/dmt_tx/const_encoder/tb/tb_const_enc.v,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- tb_const_enc.v 26 Jul 2007 16:57:01 -0000 1.4
+++ tb_const_enc.v 27 Jul 2007 02:15:11 -0000 1.5
@@ -71,6 +71,9 @@
// instantiate test data modules
//
const_map_2bit cm_2bit();
+const_map_3bit cm_3bit();
+const_map_4bit cm_4bit();
+const_map_5bit cm_5bit();
initial begin
@@ -141,6 +144,9 @@
// checking the constellation map
//
check_const_map(2);
+ check_const_map(3);
+ check_const_map(4);
+ check_const_map(5);
#1000 $finish();
@@ -245,10 +251,12 @@
dut.cin <= i;
@ (posedge clk);
+ @ (posedge clk);
@ (negedge clk);
// compare output with expected result
case (bit)
1: $display("%d bit is not support constellation size", bit);
+
2: 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);
@@ -257,6 +265,35 @@
$display("Input: %d --> y_o expected: %d got: %d", i, cm_2bit.im[i], y_o);
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);
endcase
|
 |