avl_dacfifo: Fix the avalon address switch
parent
04f397f688
commit
da68705fee
|
@ -78,8 +78,9 @@ module avl_dacfifo #(
|
|||
reg dac_bypass = 1'b0;
|
||||
reg dac_xfer_out_m1 = 1'b0;
|
||||
reg dac_xfer_out_bypass = 1'b0;
|
||||
reg avl_xfer_req_m1 = 1'b0;
|
||||
reg avl_xfer_req = 1'b0;
|
||||
reg avl_xfer_wren = 1'b0;
|
||||
reg avl_dma_xfer_req = 1'b0;
|
||||
reg avl_dma_xfer_req_m1 = 1'b0;
|
||||
|
||||
// internal signals
|
||||
|
||||
|
@ -156,8 +157,21 @@ module avl_dacfifo #(
|
|||
// avalon address multiplexer and output registers
|
||||
|
||||
always @(posedge avl_clk) begin
|
||||
avl_xfer_req_m1 <= dma_xfer_req;
|
||||
avl_xfer_req <= avl_xfer_req_m1;
|
||||
avl_dma_xfer_req_m1 <= dma_xfer_req;
|
||||
avl_dma_xfer_req <= avl_dma_xfer_req_m1;
|
||||
end
|
||||
|
||||
always @(posedge avl_clk) begin
|
||||
if (avl_reset == 1) begin
|
||||
avl_xfer_wren <= 0;
|
||||
end else begin
|
||||
if (avl_dma_xfer_req == 1) begin
|
||||
avl_xfer_wren <= 1;
|
||||
end
|
||||
if (avl_xfer_out_s == 1) begin
|
||||
avl_xfer_wren <= 0;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
always @(posedge avl_clk) begin
|
||||
|
@ -169,9 +183,9 @@ module avl_dacfifo #(
|
|||
avl_write <= 0;
|
||||
avl_writedata <= 0;
|
||||
end else begin
|
||||
avl_address <= (avl_xfer_req == 1'b1) ? avl_wr_address_s : avl_rd_address_s;
|
||||
avl_burstcount <= (avl_xfer_req == 1'b1) ? avl_wr_burstcount_s : avl_rd_burstcount_s;
|
||||
avl_byteenable <= (avl_xfer_req == 1'b1) ? avl_wr_byteenable_s : avl_rd_byteenable_s;
|
||||
avl_address <= (avl_xfer_wren == 1'b1) ? avl_wr_address_s : avl_rd_address_s;
|
||||
avl_burstcount <= (avl_xfer_wren == 1'b1) ? avl_wr_burstcount_s : avl_rd_burstcount_s;
|
||||
avl_byteenable <= (avl_xfer_wren == 1'b1) ? avl_wr_byteenable_s : avl_rd_byteenable_s;
|
||||
avl_read <= avl_read_s;
|
||||
avl_write <= avl_write_s;
|
||||
avl_writedata <= avl_writedata_s;
|
||||
|
|
Loading…
Reference in New Issue