Commit cedb78c5 authored by Andrey Filippov's avatar Andrey Filippov

Added Python module to program AXI HP multiplexer for compressed image data

parent f35b9514
...@@ -60,6 +60,7 @@ import x393_mcntrl_membridge ...@@ -60,6 +60,7 @@ import x393_mcntrl_membridge
import x393_sens_cmprs import x393_sens_cmprs
import x393_camsync import x393_camsync
import x393_gpio import x393_gpio
import x393_cmprs_afi
import vrlg import vrlg
__all__ = [] __all__ = []
__version__ = 0.1 __version__ = 0.1
...@@ -338,6 +339,7 @@ USAGE ...@@ -338,6 +339,7 @@ USAGE
x393SensCmprs= x393_sens_cmprs.X393SensCmprs(verbose,args.simulated,args.localparams) x393SensCmprs= x393_sens_cmprs.X393SensCmprs(verbose,args.simulated,args.localparams)
x393Camsync= x393_camsync.X393Camsync(verbose,args.simulated,args.localparams) x393Camsync= x393_camsync.X393Camsync(verbose,args.simulated,args.localparams)
x393GPIO= x393_gpio.X393GPIO(verbose,args.simulated,args.localparams) x393GPIO= x393_gpio.X393GPIO(verbose,args.simulated,args.localparams)
x393CmprsAfi= x393_cmprs_afi.X393CmprsAfi(verbose,args.simulated,args.localparams)
''' '''
print ("----------------------") print ("----------------------")
print("x393_mem.__dict__="+str(x393_mem.__dict__)) print("x393_mem.__dict__="+str(x393_mem.__dict__))
...@@ -365,6 +367,7 @@ USAGE ...@@ -365,6 +367,7 @@ USAGE
extractTasks(x393_sens_cmprs.X393SensCmprs, x393SensCmprs) extractTasks(x393_sens_cmprs.X393SensCmprs, x393SensCmprs)
extractTasks(x393_camsync.X393Camsync, x393Camsync) extractTasks(x393_camsync.X393Camsync, x393Camsync)
extractTasks(x393_gpio.X393GPIO, x393GPIO) extractTasks(x393_gpio.X393GPIO, x393GPIO)
extractTasks(x393_cmprs_afi.X393CmprsAfi, x393CmprsAfi)
for cmdLine in commands: for cmdLine in commands:
print ('Running task: '+str(cmdLine)) print ('Running task: '+str(cmdLine))
......
This diff is collapsed.
...@@ -2441,7 +2441,7 @@ task write_cmd_frame_sequencer; ...@@ -2441,7 +2441,7 @@ task write_cmd_frame_sequencer;
0, // input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently 0, // input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently
// both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1, // both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2 // ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2
// May be chenged to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1, // May be changed to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3 // ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3
num_sensor, // input [1:0] chn_afi; num_sensor, // input [1:0] chn_afi;
3, // input [1:0] mode; 3, // input [1:0] mode;
...@@ -2551,6 +2551,7 @@ task camsync_setup; ...@@ -2551,6 +2551,7 @@ task camsync_setup;
end end
endtask endtask
// x393_cmprs_afi.py
task afi_mux_setup; task afi_mux_setup;
input [3:0] chn_mask; input [3:0] chn_mask;
input [26:0] afi_cmprs0_sa; // input [26:0] sa; // start address in 32-byte chunks input [26:0] afi_cmprs0_sa; // input [26:0] sa; // start address in 32-byte chunks
...@@ -2570,7 +2571,7 @@ task afi_mux_setup; ...@@ -2570,7 +2571,7 @@ task afi_mux_setup;
0, // input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently 0, // input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently
// both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1, // both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2 // ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2
// May be chenged to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1, // May be changed to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3 // ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3
i, // num_sensor, // input [1:0] chn_afi; i, // num_sensor, // input [1:0] chn_afi;
3, // input [1:0] mode; 3, // input [1:0] mode;
...@@ -3728,11 +3729,12 @@ function [31 : 0] func_compressor_color_saturation; ...@@ -3728,11 +3729,12 @@ function [31 : 0] func_compressor_color_saturation;
endfunction endfunction
// axi_hp channels for the compressed image data // axi_hp channels for the compressed image data
// x393_cmprs_afi.py
task afi_mux_program_status; task afi_mux_program_status;
input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently
// both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1, // both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2 // ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2
// May be chenged to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1, // May be changed to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3 // ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3
input [1:0] chn_afi; input [1:0] chn_afi;
input [1:0] mode; input [1:0] mode;
...@@ -3747,11 +3749,12 @@ task afi_mux_program_status; ...@@ -3747,11 +3749,12 @@ task afi_mux_program_status;
end end
endtask endtask
// x393_cmprs_afi.py
task afi_mux_reset; task afi_mux_reset;
input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently
// both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1, // both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2 // ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2
// May be chenged to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1, // May be changed to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3 // ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3
input [3:0] rst_chn; input [3:0] rst_chn;
reg [29:0] reg_addr; reg [29:0] reg_addr;
...@@ -3761,11 +3764,12 @@ task afi_mux_reset; ...@@ -3761,11 +3764,12 @@ task afi_mux_reset;
end end
endtask endtask
// x393_cmprs_afi.py
task afi_mux_enable_chn; task afi_mux_enable_chn;
input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently
// both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1, // both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2 // ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2
// May be chenged to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1, // May be changed to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3 // ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3
input [1:0] en_chn; // channel number to enable/disable; input [1:0] en_chn; // channel number to enable/disable;
input en; input en;
...@@ -3779,11 +3783,12 @@ task afi_mux_enable_chn; ...@@ -3779,11 +3783,12 @@ task afi_mux_enable_chn;
end end
endtask endtask
// x393_cmprs_afi.py
task afi_mux_enable; task afi_mux_enable;
input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently
// both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1, // both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2 // ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2
// May be chenged to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1, // May be changed to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3 // ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3
input en; input en;
reg [29:0] reg_addr; reg [29:0] reg_addr;
...@@ -3796,11 +3801,12 @@ task afi_mux_enable; ...@@ -3796,11 +3801,12 @@ task afi_mux_enable;
end end
endtask endtask
// x393_cmprs_afi.py
task afi_mux_mode_chn; task afi_mux_mode_chn;
input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently
// both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1, // both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2 // ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2
// May be chenged to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1, // May be changed to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3 // ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3
input [1:0] chn; // channel number to set mode for input [1:0] chn; // channel number to set mode for
input [1:0] mode; input [1:0] mode;
...@@ -3822,11 +3828,12 @@ each group of 4 bits per channel : bits [1:0] - select, bit[2] - sset (0 - nop), ...@@ -3822,11 +3828,12 @@ each group of 4 bits per channel : bits [1:0] - select, bit[2] - sset (0 - nop),
end end
endtask endtask
// x393_cmprs_afi.py
task afi_mux_chn_start_length; task afi_mux_chn_start_length;
input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently input [0:0] port_afi; // number of AFI port (0 - afi 1, 1 - afi2) // configuration controlled by the code. currently
// both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1, // both AFI are used: ch0 - cmprs_afi_mux_1.0, ch1 - cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2 // ch2 - cmprs_afi_mux_2.0, ch3 - cmprs_afi_mux_2
// May be chenged to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1, // May be changed to ch0 - cmprs_afi_mux_1.0, ch1 -cmprs_afi_mux_1.1,
// ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3 // ch2 - cmprs_afi_mux_1.2, ch3 - cmprs_afi_mux_1.3
input [ 1:0] chn; // channel number to set mode for input [ 1:0] chn; // channel number to set mode for
input [26:0] sa; // start address in 32-byte chunks input [26:0] sa; // start address in 32-byte chunks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment