URL
https://opencores.org/ocsvn/dmt_tx/dmt_tx/trunk
Subversion Repositories dmt_tx
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 21 to Rev 22
- ↔ Reverse comparison
Rev 21 → Rev 22
/trunk/const_encoder/rtl/const_enc.v
171,7 → 171,7
|
4'b0011: begin // #3 |
case (cin[2:0]) |
3'b000: begin x_o <= 9'b000000001; y_o <= 9'b000000011; end |
3'b000: begin x_o <= 9'b000000001; y_o <= 9'b000000001; end |
3'b001: begin x_o <= 9'b000000001; y_o <= 9'b111111111; end |
3'b010: begin x_o <= 9'b111111111; y_o <= 9'b000000001; end |
3'b011: begin x_o <= 9'b111111111; y_o <= 9'b111111111; end |
184,14 → 184,14
end |
|
4'b0100: begin // #4 |
x_o <= {cin[2], cin[2], cin[2], cin[2], cin[2], cin[2], cin[2], cin[0], 1'b1}; |
y_o <= {cin[3], cin[3], cin[3], cin[3], cin[3], cin[3], cin[3], cin[1], 1'b1}; |
x_o <= {cin[3], cin[3], cin[3], cin[3], cin[3], cin[3], cin[3], cin[1], 1'b1}; |
y_o <= {cin[2], cin[2], cin[2], cin[2], cin[2], cin[2], cin[2], cin[0], 1'b1}; |
end |
|
4'b0101: begin // #5 |
map_msb(cin[4:0], msb_x, msb_y); |
x_o <= {msb_x[1], msb_x[1], msb_x[1], msb_x[1], msb_x[1], msb_x[1], msb_x[0], 1'b1}; |
y_o <= {msb_y[1], msb_y[1], msb_y[1], msb_y[1], msb_y[1], msb_y[1], msb_y[0], 1'b1}; |
x_o <= {msb_x[1], msb_x[1], msb_x[1], msb_x[1], msb_x[1], msb_x[1], msb_x[0], cin[1], 1'b1}; |
y_o <= {msb_y[1], msb_y[1], msb_y[1], msb_y[1], msb_y[1], msb_y[1], msb_y[0], cin[0], 1'b1}; |
end |
|
4'b0110: begin // #6 |
/trunk/const_encoder/tb/const_map_data.v
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 |
/trunk/const_encoder/tb/tb_const_enc.v
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 |
|