Changeset 9096
- Timestamp:
- 07/31/08 20:21:43
- Files:
-
- usrp2/trunk/fpga/sdr_lib/tx_control.v (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
usrp2/trunk/fpga/sdr_lib/tx_control.v
r8632 r9096 23 23 input strobe, 24 24 25 // FIFO Levels 26 output [15:0] fifo_occupied, 27 output fifo_full, 28 output fifo_empty, 29 30 // Debug 25 31 output [31:0] debug 26 32 ); … … 41 47 if(rst) 42 48 xfer_state <= XFER_IDLE; 43 else 44 case(xfer_state) 45 XFER_IDLE : 46 if(rd_sop_i) 47 xfer_state <= XFER_1; 48 XFER_1 : 49 begin 50 xfer_state <= XFER_2; 51 held_flags <= rd_dat_i[2:0]; 52 end 53 XFER_2 : 54 if(~full_ctrl) 55 xfer_state <= XFER_DATA; 56 XFER_DATA : 57 if(rd_eop_i & ~full_data) 58 xfer_state <= XFER_IDLE; 59 endcase // case(xfer_state) 49 else 50 if(clear_state) 51 xfer_state <= XFER_IDLE; 52 else 53 case(xfer_state) 54 XFER_IDLE : 55 if(rd_sop_i) 56 xfer_state <= XFER_1; 57 XFER_1 : 58 begin 59 xfer_state <= XFER_2; 60 held_flags <= rd_dat_i[2:0]; 61 end 62 XFER_2 : 63 if(~full_ctrl) 64 xfer_state <= XFER_DATA; 65 XFER_DATA : 66 if(rd_eop_i & ~full_data) 67 xfer_state <= XFER_IDLE; 68 endcase // case(xfer_state) 60 69 61 70 assign write_data = (xfer_state == XFER_DATA) & ~full_data; … … 69 78 wire sop_o, eop_o, eob, sob, send_imm; 70 79 wire [31:0] sendtime; 80 wire [4:0] occ_ctrl; 71 81 72 82 cascadefifo2 #(.WIDTH(34),.SIZE(FIFOSIZE)) txctrlfifo 73 83 (.clk(clk),.rst(rst),.clear(clear_state), 74 84 .datain({rd_sop_i,rd_eop_i,rd_dat_i}), .write(write_data), .full(full_data), 75 .dataout({sop_o,eop_o,data_o}), .read(read_data), .empty(empty_data) ); 85 .dataout({sop_o,eop_o,data_o}), .read(read_data), .empty(empty_data), 86 .space(), .occupied(fifo_occupied) ); 87 assign fifo_full = full_data; 88 assign fifo_empty = empty_data; 76 89 77 90 shortfifo #(.WIDTH(35)) ctrlfifo 78 91 (.clk(clk),.rst(rst),.clear(clear_state), 79 92 .datain({held_flags[2:0],rd_dat_i}), .write(write_ctrl), .full(full_ctrl), 80 .dataout({send_imm,sob,eob,sendtime}), .read(read_ctrl), .empty(empty_ctrl) ); 93 .dataout({send_imm,sob,eob,sendtime}), .read(read_ctrl), .empty(empty_ctrl), 94 .space(), .occupied(occ_ctrl) ); 81 95 82 96 // Internal FIFO to DSP interface … … 140 154 assign sample = data_o; 141 155 142 assign debug = { 16'd0,143 { eop_o, eob, send_imm ,too_late, go_now, ibs_state[2:0] },144 empty_data, empty_ctrl, read_data, read_ctrl, strobe, clear_state, run, underrun};156 assign debug = { {16'b0}, 157 { read_data, write_data, read_ctrl, write_ctrl, xfer_state[1:0],full_ctrl,empty_ctrl }, 158 { occ_ctrl, eop_o, clear_state, underrun} }; 145 159 146 160 endmodule // tx_control
