diff --git a/common/sv/adi_regmap_dmac_pkg.sv b/common/sv/adi_regmap_dmac_pkg.sv index 19a58705..137fbca9 100644 --- a/common/sv/adi_regmap_dmac_pkg.sv +++ b/common/sv/adi_regmap_dmac_pkg.sv @@ -180,9 +180,14 @@ package adi_regmap_dmac_pkg; `define UPDATE_DMAC_IRQ_SOURCE_TRANSFER_QUEUED(x,y) UpdateField(DMAC_IRQ_SOURCE,"TRANSFER_QUEUED",x,y) const reg_t DMAC_CONTROL = '{ 'h0400, "CONTROL" , '{ + "FRAMELOCK": '{ 3, 3, RW, 'h0 }, "HWDESC": '{ 2, 2, RW, 'h0 }, "PAUSE": '{ 1, 1, RW, 'h0 }, "ENABLE": '{ 0, 0, RW, 'h0 }}}; + `define SET_DMAC_CONTROL_FRAMELOCK(x) SetField(DMAC_CONTROL,"FRAMELOCK",x) + `define GET_DMAC_CONTROL_FRAMELOCK(x) GetField(DMAC_CONTROL,"FRAMELOCK",x) + `define DEFAULT_DMAC_CONTROL_FRAMELOCK GetResetValue(DMAC_CONTROL,"FRAMELOCK") + `define UPDATE_DMAC_CONTROL_FRAMELOCK(x,y) UpdateField(DMAC_CONTROL,"FRAMELOCK",x,y) `define SET_DMAC_CONTROL_HWDESC(x) SetField(DMAC_CONTROL,"HWDESC",x) `define GET_DMAC_CONTROL_HWDESC(x) GetField(DMAC_CONTROL,"HWDESC",x) `define DEFAULT_DMAC_CONTROL_HWDESC GetResetValue(DMAC_CONTROL,"HWDESC") @@ -211,14 +216,9 @@ package adi_regmap_dmac_pkg; `define UPDATE_DMAC_TRANSFER_SUBMIT_TRANSFER_SUBMIT(x,y) UpdateField(DMAC_TRANSFER_SUBMIT,"TRANSFER_SUBMIT",x,y) const reg_t DMAC_FLAGS = '{ 'h040c, "FLAGS" , '{ - "FRAMELOCK": '{ 3, 3, RW, 0 }, "PARTIAL_REPORTING_EN": '{ 2, 2, RW, 0 }, "TLAST": '{ 1, 1, RW, 0 }, "CYCLIC": '{ 0, 0, RW, 0 }}}; - `define SET_DMAC_FLAGS_FRAMELOCK(x) SetField(DMAC_FLAGS,"FRAMELOCK",x) - `define GET_DMAC_FLAGS_FRAMELOCK(x) GetField(DMAC_FLAGS,"FRAMELOCK",x) - `define DEFAULT_DMAC_FLAGS_FRAMELOCK GetResetValue(DMAC_FLAGS,"FRAMELOCK") - `define UPDATE_DMAC_FLAGS_FRAMELOCK(x,y) UpdateField(DMAC_FLAGS,"FRAMELOCK",x,y) `define SET_DMAC_FLAGS_PARTIAL_REPORTING_EN(x) SetField(DMAC_FLAGS,"PARTIAL_REPORTING_EN",x) `define GET_DMAC_FLAGS_PARTIAL_REPORTING_EN(x) GetField(DMAC_FLAGS,"PARTIAL_REPORTING_EN",x) `define DEFAULT_DMAC_FLAGS_PARTIAL_REPORTING_EN GetResetValue(DMAC_FLAGS,"PARTIAL_REPORTING_EN") diff --git a/common/sv/dmac_api.sv b/common/sv/dmac_api.sv index fa217fc0..00e8f718 100644 --- a/common/sv/dmac_api.sv +++ b/common/sv/dmac_api.sv @@ -92,7 +92,7 @@ package dmac_api_pkg; this.axi_write(GetAddrs(DMAC_Y_LENGTH), 32'h0); end this.axi_read(GetAddrs(DMAC_FLAGS), val); - p.FRAMELOCK = `GET_DMAC_FLAGS_FRAMELOCK(val); + p.FRAMELOCK = `GET_DMAC_CONTROL_FRAMELOCK(val); endtask : discover_params // ----------------- @@ -134,6 +134,17 @@ package dmac_api_pkg; `SET_DMAC_CONTROL_PAUSE(0)); endtask : disable_dma + // ----------------- + // + // ----------------- + task set_control(input bit[3:0] control); + this.axi_write(GetAddrs(DMAC_CONTROL), + `SET_DMAC_CONTROL_ENABLE(control[0]) | + `SET_DMAC_CONTROL_PAUSE(control[1]) | + `SET_DMAC_CONTROL_HWDESC(control[2]) | + `SET_DMAC_CONTROL_FRAMELOCK(control[3])); + endtask : set_control + // ----------------- // // ----------------- @@ -141,8 +152,7 @@ package dmac_api_pkg; this.axi_write(GetAddrs(DMAC_FLAGS), `SET_DMAC_FLAGS_CYCLIC(flags[0]) | `SET_DMAC_FLAGS_TLAST(flags[1]) | - `SET_DMAC_FLAGS_PARTIAL_REPORTING_EN(flags[2]) | - `SET_DMAC_FLAGS_FRAMELOCK(flags[3])); + `SET_DMAC_FLAGS_PARTIAL_REPORTING_EN(flags[2])); endtask : set_flags // ----------------- diff --git a/dma_flock/cfgs/cfg3_fsync_autorun.tcl b/dma_flock/cfgs/cfg3_fsync_autorun.tcl index b4eec556..0da1d5a4 100644 --- a/dma_flock/cfgs/cfg3_fsync_autorun.tcl +++ b/dma_flock/cfgs/cfg3_fsync_autorun.tcl @@ -26,7 +26,7 @@ set m_dma_cfg [list \ DMA_2D_TLAST_MODE {1} \ \ AUTORUN $AUTORUN \ - AUTORUN_FLAGS {0xB} \ + AUTORUN_FLAGS {0x13} \ AUTORUN_SRC_ADDR {0x00000000} \ AUTORUN_DEST_ADDR {0x00001000} \ AUTORUN_X_LENGTH {0x3FF} \ @@ -50,7 +50,7 @@ set s_dma_cfg [list \ DMA_2D_TLAST_MODE {1} \ \ AUTORUN $AUTORUN \ - AUTORUN_FLAGS {0xB} \ + AUTORUN_FLAGS {0x13} \ AUTORUN_SRC_ADDR {0x00001000} \ AUTORUN_DEST_ADDR {0x00000000} \ AUTORUN_X_LENGTH {0x3FF} \ diff --git a/dma_flock/tests/test_program.sv b/dma_flock/tests/test_program.sv index 15dff109..fe6d5ccb 100644 --- a/dma_flock/tests/test_program.sv +++ b/dma_flock/tests/test_program.sv @@ -175,11 +175,11 @@ program test_program; env.ref_src_axis_seq.start(); `endif - m_dmac_api.enable_dma(); - m_dmac_api.set_flags('b1111); + m_dmac_api.set_control('b1001); + m_dmac_api.set_flags('b111); - s_dmac_api.enable_dma(); - s_dmac_api.set_flags('b1111); + s_dmac_api.set_control('b1001); + s_dmac_api.set_flags('b111); `ifdef HAS_XIL_VDMA // Config S2MM diff --git a/dma_flock/tests/test_program_frame_delay.sv b/dma_flock/tests/test_program_frame_delay.sv index 7d1c663e..9074413a 100644 --- a/dma_flock/tests/test_program_frame_delay.sv +++ b/dma_flock/tests/test_program_frame_delay.sv @@ -136,6 +136,7 @@ program test_program_frame_delay; // Get parameters autorun_flock_framenum = `TH.`DUT_RX_DMA.inst.AUTORUN_FRAMELOCK_CONFIG & 'hFF; autorun_flock_distance = (((`TH.`DUT_RX_DMA.inst.AUTORUN_FRAMELOCK_CONFIG) >> 16) & 'hFF) + 1; + singleTest( .frame_num(10), .flock_framenum(autorun_flock_framenum), @@ -217,11 +218,11 @@ program test_program_frame_delay; `endif if (has_autorun == 0) begin - m_dmac_api.enable_dma(); - m_dmac_api.set_flags('b1111); + m_dmac_api.set_control('b1001); + m_dmac_api.set_flags('b111); - s_dmac_api.enable_dma(); - s_dmac_api.set_flags('b1111); + s_dmac_api.set_control('b1001); + s_dmac_api.set_flags('b111); end `ifdef HAS_XIL_VDMA