Changeset 117
- Timestamp:
- Feb 15, 2011, 10:42:52 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/MultiChannelUSB/deconv.v
r116 r117 2 2 #( 3 3 parameter size = 1, // number of channels 4 parameter width = 16// bit width of the input data4 parameter width = 24 // bit width of the input data 5 5 ) 6 6 ( … … 29 29 wire [size*widthr-1:0] out_data_wire; 30 30 31 reg [size*widthr-1:0] mul_data_reg [7:0], mul_data_next [7:0];32 31 wire [size*widthr-1:0] mul_data_wire [1:0]; 33 32 … … 35 34 wire [size*width2-1:0] acc_data_wire; 36 35 37 reg [size*width1-1:0] sub_data_reg [3:0], sub_data_next [3:0];38 36 wire [size*width1-1:0] sub_data_wire; 39 37 … … 101 99 .lpm_type("LPM_ADD_SUB"), 102 100 .lpm_width(width2)) acc_unit_1 ( 103 .dataa({{(width2-width1+1){sub_data_ reg[0][j*width1+width1-1]}}, sub_data_reg[0][j*width1+width1-2:j*width1]}),101 .dataa({{(width2-width1+1){sub_data_wire[j*width1+width1-1]}}, sub_data_reg[0][j*width1+width1-2:j*width1]}), 104 102 .datab(acc_data_reg[0][j*width2+width2-1:j*width2]), 105 103 .result(acc_data_wire[j*width2+width2-1:j*width2])); … … 115 113 .clock(clock), 116 114 .clken(int_wren_reg), 117 .dataa(sub_data_ reg[0][j*width1+width1-1:j*width1]),115 .dataa(sub_data_wire[j*width1+width1-1:j*width1]), 118 116 .datab({1'b0, tau_data_reg[j*16+16-1:j*16]}), 119 117 .result(mul_data_wire[0][j*widthr+widthr-1:j*widthr])); … … 139 137 .lpm_type("LPM_ADD_SUB"), 140 138 .lpm_width(widthr)) add_unit_2 ( 141 .dataa(mul_data_ reg[0][j*widthr+widthr-1:j*widthr]),142 .datab(mul_data_ reg[1][j*widthr+widthr-1:j*widthr]),139 .dataa(mul_data_wire[0][j*widthr+widthr-1:j*widthr]), 140 .datab(mul_data_wire[1][j*widthr+widthr-1:j*widthr]), 143 141 .result(out_data_wire[j*widthr+widthr-1:j*widthr])); 144 142 143 /* 144 lpm_clshift #( 145 .lpm_shifttype("LOGICAL"), 146 .lpm_type("LPM_CLSHIFT"), 147 .lpm_width(64), 148 .lpm_widthdist(6)) shift_unit_1 ( 149 .distance(distance), 150 .direction(sub_wire1), 151 .data(data), 152 .result(sub_wire0)); 153 */ 145 154 end 146 155 endgenerate … … 209 218 for(i = 0; i <= 3; i = i + 1) 210 219 begin 211 sub_data_reg[i] <= {(size*width1){1'b0}};212 220 acc_data_reg[i] <= {(size*width2){1'b0}}; 213 end214 for(i = 0; i <= 7; i = i + 1)215 begin216 mul_data_reg[i] <= {(size*widthr){1'b0}};217 221 end 218 222 end … … 233 237 for(i = 0; i <= 3; i = i + 1) 234 238 begin 235 sub_data_reg[i] <= sub_data_next[i];236 239 acc_data_reg[i] <= acc_data_next[i]; 237 240 end 238 for(i = 0; i <= 7; i = i + 1)239 begin240 mul_data_reg[i] <= mul_data_next[i];241 end242 241 end 243 242 end … … 259 258 for(i = 0; i <= 3; i = i + 1) 260 259 begin 261 sub_data_next[i] = sub_data_reg[i];262 260 acc_data_next[i] = acc_data_reg[i]; 263 261 end 264 for(i = 0; i <= 7; i = i + 1)265 begin266 mul_data_next[i] = mul_data_reg[i];267 end268 262 269 263 case (int_case_reg) … … 283 277 for(i = 0; i <= 3; i = i + 1) 284 278 begin 285 sub_data_next[i] = {(size*width1){1'b0}};286 279 acc_data_next[i] = {(size*width2){1'b0}}; 287 280 end 288 for(i = 0; i <= 7; i = i + 1)289 begin290 mul_data_next[i] = {(size*widthr){1'b0}};291 end292 281 293 282 int_case_next = 3'd1; … … 321 310 // prepare registers for 1st sum 322 311 inp_data_next[0] = inp_data_wire[0]; 323 324 sub_data_next[0] = sub_data_reg[1];325 312 acc_data_next[0] = acc_data_reg[1]; 326 313 327 mul_data_next[0] = mul_data_reg[2];328 mul_data_next[1] = mul_data_reg[3];329 330 314 tau_data_next = tau_data_wire[0]; 331 315 amp_data_next = amp_data_wire[0]; … … 344 328 // prepare registers for 2nd sum 345 329 inp_data_next[0] = inp_data_reg[1]; 346 347 sub_data_next[0] = sub_data_reg[2];348 330 acc_data_next[0] = acc_data_reg[2]; 349 331 350 mul_data_next[0] = mul_data_reg[4];351 mul_data_next[1] = mul_data_reg[5];352 353 332 tau_data_next = tau_data_wire[1]; 354 333 amp_data_next = amp_data_wire[1]; 355 334 356 335 // register 1st sum 357 sub_data_next[1] = sub_data_wire;358 336 acc_data_next[1] = acc_data_wire; 359 mul_data_next[2] = mul_data_wire[0];360 mul_data_next[3] = mul_data_wire[1];361 337 out_data_next[0] = out_data_wire; 362 338 … … 369 345 // prepare registers for 3rd sum 370 346 inp_data_next[0] = inp_data_reg[2]; 371 372 sub_data_next[0] = sub_data_reg[3];373 347 acc_data_next[0] = acc_data_reg[3]; 374 375 mul_data_next[0] = mul_data_reg[6];376 mul_data_next[1] = mul_data_reg[7];377 348 378 349 tau_data_next = tau_data_wire[2]; … … 380 351 381 352 // register 2nd sum 382 sub_data_next[2] = sub_data_wire;383 353 acc_data_next[2] = acc_data_wire; 384 mul_data_next[4] = mul_data_wire[0];385 mul_data_next[5] = mul_data_wire[1];386 354 out_data_next[1] = out_data_wire; 387 355 … … 398 366 399 367 // register 3rd sum 400 sub_data_next[3] = sub_data_wire;401 368 acc_data_next[3] = acc_data_wire; 402 mul_data_next[6] = mul_data_wire[0];403 mul_data_next[7] = mul_data_wire[1];404 369 out_data_next[2] = out_data_wire; 405 370
Note:
See TracChangeset
for help on using the changeset viewer.