Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393
Commits
7b053ece
Commit
7b053ece
authored
Mar 29, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added exyta union field to all unions/structures
parent
a821207d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1151 additions
and
717 deletions
+1151
-717
x393.c
py393/generated/x393.c
+292
-292
x393_types.h
py393/generated/x393_types.h
+817
-382
x393_export_c.py
py393/x393_export_c.py
+42
-43
No files found.
py393/generated/x393.c
View file @
7b053ece
This source diff could not be displayed because it is too large. You can
view the blob
instead.
py393/generated/x393_types.h
View file @
7b053ece
...
@@ -7,237 +7,375 @@
...
@@ -7,237 +7,375 @@
// Status generation control
// Status generation control
typedef
struct
{
typedef
union
{
u32
mode
:
2
;
// [ 7: 6] (3) Status report mode: 0 - disable, 1 - single, 2 - auto, keep sequence number, 3 - auto, inc. seq. number
struct
{
u32
seq_num
:
6
;
// [ 5: 0] (0) 6-bit sequence number to be used with the next status response
u32
:
24
;
u32
mode
:
2
;
// [ 7: 6] (3) Status report mode: 0 - disable, 1 - single, 2 - auto, keep sequence number, 3 - auto, inc. seq. number
u32
seq_num
:
6
;
// [ 5: 0] (0) 6-bit sequence number to be used with the next status response
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_status_ctrl_t
;
}
x393_status_ctrl_t
;
// Memory channel operation mode
// Memory channel operation mode
typedef
struct
{
typedef
union
{
u32
skip_too_late
:
1
;
// [ 12] (0) Skip over missed blocks to preserve frame structure (increment pointers)
struct
{
u32
disable_need
:
1
;
// [ 11] (0) disable 'need' generation, only 'want' (compressor channels)
u32
:
19
;
u32
repetitive
:
1
;
// [ 10] (1) run repetitive frames
u32
skip_too_late
:
1
;
// [ 12] (0) Skip over missed blocks to preserve frame structure (increment pointers)
u32
single
:
1
;
// [ 9] (0) run single frame
u32
disable_need
:
1
;
// [ 11] (0) disable 'need' generation, only 'want' (compressor channels)
u32
reset_frame
:
1
;
// [ 8] (0) reset frame number
u32
repetitive
:
1
;
// [ 10] (1) run repetitive frames
u32
:
1
;
u32
single
:
1
;
// [ 9] (0) run single frame
u32
byte32
:
1
;
// [ 6] (1) 32-byte columns (0 - 16-byte), not used in scanline mode
u32
reset_frame
:
1
;
// [ 8] (0) reset frame number
u32
keep_open
:
1
;
// [ 5] (0) for 8 or less rows - do not close page between accesses (not used in scanline mode)
u32
:
1
;
u32
extra_pages
:
2
;
// [ 4: 3] (0) 2-bit number of extra pages that need to stay (not to be overwritten) in the buffer
u32
byte32
:
1
;
// [ 6] (1) 32-byte columns (0 - 16-byte), not used in scanline mode
u32
write_mem
:
1
;
// [ 2] (0) 0 - read from memory, 1 - write to memory
u32
keep_open
:
1
;
// [ 5] (0) for 8 or less rows - do not close page between accesses (not used in scanline mode)
u32
chn_nreset
:
1
;
// [ 1] (1) 0: immediately reset all the internal circuitry
u32
extra_pages
:
2
;
// [ 4: 3] (0) 2-bit number of extra pages that need to stay (not to be overwritten) in the buffer
u32
enable
:
1
;
// [ 0] (1) enable requests from this channel ( 0 will let current to finish, but not raise want/need)
u32
write_mem
:
1
;
// [ 2] (0) 0 - read from memory, 1 - write to memory
u32
chn_nreset
:
1
;
// [ 1] (1) 0: immediately reset all the internal circuitry
u32
enable
:
1
;
// [ 0] (1) enable requests from this channel ( 0 will let current to finish, but not raise want/need)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntrl_mode_scan_t
;
}
x393_mcntrl_mode_scan_t
;
// Memory channel window tile size/step (tiled only)
// Memory channel window tile size/step (tiled only)
typedef
struct
{
typedef
union
{
u32
vert_step
:
8
;
// [23:16] (0x10) Tile vertical step to control tile overlap
struct
{
u32
:
2
;
u32
:
8
;
u32
tile_height
:
6
;
// [13: 8] (0x12) tile height in lines (0 means 64 lines)
u32
vert_step
:
8
;
// [23:16] (0x10) Tile vertical step to control tile overlap
u32
:
2
;
u32
:
2
;
u32
tile_width
:
6
;
// [ 5: 0] (2) tile width in 8-bursts (16 bytes)
u32
tile_height
:
6
;
// [13: 8] (0x12) tile height in lines (0 means 64 lines)
u32
:
2
;
u32
tile_width
:
6
;
// [ 5: 0] (2) tile width in 8-bursts (16 bytes)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntrl_window_tile_whs_t
;
}
x393_mcntrl_window_tile_whs_t
;
// Memory channel window size
// Memory channel window size
typedef
struct
{
typedef
union
{
u32
height
:
16
;
// [31:16] (0) 16-bit window height in scan lines
struct
{
u32
:
3
;
u32
height
:
16
;
// [31:16] (0) 16-bit window height in scan lines
u32
width
:
13
;
// [12: 0] (0) 13-bit window width - in 8*16=128 bit bursts
u32
:
3
;
u32
width
:
13
;
// [12: 0] (0) 13-bit window width - in 8*16=128 bit bursts
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntrl_window_width_height_t
;
}
x393_mcntrl_window_width_height_t
;
// Memory channel window position
// Memory channel window position
typedef
struct
{
typedef
union
{
u32
top
:
16
;
// [31:16] (0) 16-bit window top margin in scan lines
struct
{
u32
:
3
;
u32
top
:
16
;
// [31:16] (0) 16-bit window top margin in scan lines
u32
left
:
13
;
// [12: 0] (0) 13-bit window left margin in 8-bursts (16 bytes)
u32
:
3
;
u32
left
:
13
;
// [12: 0] (0) 13-bit window left margin in 8-bursts (16 bytes)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntrl_window_left_top_t
;
}
x393_mcntrl_window_left_top_t
;
// Memory channel scan start (debug feature)
// Memory channel scan start (debug feature)
typedef
struct
{
typedef
union
{
u32
start_y
:
16
;
// [31:16] (0) 16-bit window start Y relative to window top margin (debug feature, set = 0)
struct
{
u32
:
3
;
u32
start_y
:
16
;
// [31:16] (0) 16-bit window start Y relative to window top margin (debug feature, set = 0)
u32
start_x
:
13
;
// [12: 0] (0) 13-bit window start X relative to window left margin (debug feature, set = 0)
u32
:
3
;
u32
start_x
:
13
;
// [12: 0] (0) 13-bit window start X relative to window left margin (debug feature, set = 0)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntrl_window_startx_starty_t
;
}
x393_mcntrl_window_startx_starty_t
;
// Memory channel window full (padded) width
// Memory channel window full (padded) width
typedef
struct
{
typedef
union
{
u32
full_width
:
13
;
// [12: 0] (0) 13-bit Padded line length (8-row increment), in 8-bursts (16 bytes)
struct
{
u32
:
19
;
u32
full_width
:
13
;
// [12: 0] (0) 13-bit Padded line length (8-row increment), in 8-bursts (16 bytes)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntrl_window_full_width_t
;
}
x393_mcntrl_window_full_width_t
;
// Memory channel last frame number in a buffer (number of frames minus 1)
// Memory channel last frame number in a buffer (number of frames minus 1)
typedef
struct
{
typedef
union
{
u32
last_frame_num
:
16
;
// [15: 0] (0) 16-bit number of the last frame in a buffer (1 for a 2-frame ping-pong one)
struct
{
u32
:
16
;
u32
last_frame_num
:
16
;
// [15: 0] (0) 16-bit number of the last frame in a buffer (1 for a 2-frame ping-pong one)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntrl_window_last_frame_num_t
;
}
x393_mcntrl_window_last_frame_num_t
;
// Memory channel frame start address increment (for next frame in a buffer)
// Memory channel frame start address increment (for next frame in a buffer)
typedef
struct
{
typedef
union
{
u32
frame_sa_inc
:
22
;
// [21: 0] (0) 22-bit frame start address increment (3 CA LSBs==0. BA==0)
struct
{
u32
:
10
;
u32
frame_sa_inc
:
22
;
// [21: 0] (0) 22-bit frame start address increment (3 CA LSBs==0. BA==0)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntrl_window_frame_sa_inc_t
;
}
x393_mcntrl_window_frame_sa_inc_t
;
// Memory channel frame start address for the first frame in a buffer
// Memory channel frame start address for the first frame in a buffer
typedef
struct
{
typedef
union
{
u32
frame_sa
:
22
;
// [21: 0] (0) 22-bit frame start address (3 CA LSBs==0. BA==0)
struct
{
u32
:
10
;
u32
frame_sa
:
22
;
// [21: 0] (0) 22-bit frame start address (3 CA LSBs==0. BA==0)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntrl_window_frame_sa_t
;
}
x393_mcntrl_window_frame_sa_t
;
// PS PIO (software-programmed DDR3) access sequences enable and reset
// PS PIO (software-programmed DDR3) access sequences enable and reset
typedef
struct
{
typedef
union
{
u32
en
:
1
;
// [ 1] (1) Enable PS_PIO channel. Only influences request for arbitration, started transactions will finish if disabled
struct
{
u32
nrst
:
1
;
// [ 0] (1) Active-low reset for programmed DDR3 memory sequences
u32
:
30
;
u32
en
:
1
;
// [ 1] (1) Enable PS_PIO channel. Only influences request for arbitration, started transactions will finish if disabled
u32
nrst
:
1
;
// [ 0] (1) Active-low reset for programmed DDR3 memory sequences
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_ps_pio_en_rst_t
;
}
x393_ps_pio_en_rst_t
;
// PS PIO (software-programmed DDR3) access sequences control
// PS PIO (software-programmed DDR3) access sequences control
typedef
struct
{
typedef
union
{
u32
wait_complete
:
1
;
// [ 14] (0) Do not request a new transaction from the scheduler until previous memory transaction is finished
struct
{
u32
chn
:
1
;
// [ 13] (0) channel buffer to use: 0 - memory read, 1 - memory write
u32
:
17
;
u32
urgent
:
1
;
// [ 12] (0) high priority request (only for competition with other channels, will not pass in this FIFO)
u32
wait_complete
:
1
;
// [ 14] (0) Do not request a new transaction from the scheduler until previous memory transaction is finished
u32
page
:
2
;
// [11:10] (0) Buffer page number
u32
chn
:
1
;
// [ 13] (0) channel buffer to use: 0 - memory read, 1 - memory write
u32
seq_addr
:
10
;
// [ 9: 0] (0) Sequence start address
u32
urgent
:
1
;
// [ 12] (0) high priority request (only for competition with other channels, will not pass in this FIFO)
u32
page
:
2
;
// [11:10] (0) Buffer page number
u32
seq_addr
:
10
;
// [ 9: 0] (0) Sequence start address
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_ps_pio_cmd_t
;
}
x393_ps_pio_cmd_t
;
// x393 generic status register
// x393 generic status register
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
struct
{
u32
status2
:
2
;
// [25:24] (0) 2-bit status payload (2 LSB in Verilog)
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
u32
status24
:
24
;
// [23: 0] (0) 24-bit status payload ([25:2] in Verilog
u32
status2
:
2
;
// [25:24] (0) 2-bit status payload (2 LSB in Verilog)
u32
status24
:
24
;
// [23: 0] (0) 24-bit status payload ([25:2] in Verilog
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_status_t
;
}
x393_status_t
;
// Memory PHY status
// Memory PHY status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
struct
{
u32
locked
:
1
;
// [ 25] (0) Both PLL and MMCM are locked
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
u32
ps_rdy
:
1
;
// [ 24] (0) Phase change is done
u32
locked
:
1
;
// [ 25] (0) Both PLL and MMCM are locked
u32
:
11
;
u32
ps_rdy
:
1
;
// [ 24] (0) Phase change is done
u32
dly_ready
:
1
;
// [ 12] (0) I/O delays calibration is ready
u32
:
11
;
u32
dci_ready
:
1
;
// [ 11] (0) DCI calibration is ready
u32
dly_ready
:
1
;
// [ 12] (0) I/O delays calibration is ready
u32
locked_mmcm
:
1
;
// [ 10] (0) MMCM is locked
u32
dci_ready
:
1
;
// [ 11] (0) DCI calibration is ready
u32
locked_pll
:
1
;
// [ 9] (0) PLL is locked
u32
locked_mmcm
:
1
;
// [ 10] (0) MMCM is locked
u32
run_busy
:
1
;
// [ 8] (0) Controller sequence in progress
u32
locked_pll
:
1
;
// [ 9] (0) PLL is locked
u32
ps_out
:
8
;
// [ 7: 0] (0) Current MMCM phase shift
u32
run_busy
:
1
;
// [ 8] (0) Controller sequence in progress
u32
ps_out
:
8
;
// [ 7: 0] (0) Current MMCM phase shift
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_status_mcntrl_phy_t
;
}
x393_status_mcntrl_phy_t
;
// Memory controller requests status
// Memory controller requests status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
struct
{
u32
need_some
:
1
;
// [ 25] (0) At least one channel requests urgent memory access (high priority)
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
u32
want_some
:
1
;
// [ 24] (0) At least one channel requests memory access (normal priority)
u32
need_some
:
1
;
// [ 25] (0) At least one channel requests urgent memory access (high priority)
u32
:
8
;
u32
want_some
:
1
;
// [ 24] (0) At least one channel requests memory access (normal priority)
u32
chn_want
:
16
;
// [15: 0] (0) Bit mask of the channels that request memory access
u32
:
8
;
u32
chn_want
:
16
;
// [15: 0] (0) Bit mask of the channels that request memory access
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_status_mcntrl_top_t
;
}
x393_status_mcntrl_top_t
;
// Memory software access status
// Memory software access status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
struct
{
u32
cmd_nempty_busy
:
1
;
// [ 25] (0) MCNTRL software access pending commands FIFO is not empty or command is running
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
u32
cmd_half_full
:
1
;
// [ 24] (0) MCNTRL software access pending commands FIFO is half full
u32
cmd_nempty_busy
:
1
;
// [ 25] (0) MCNTRL software access pending commands FIFO is not empty or command is running
u32
:
24
;
u32
cmd_half_full
:
1
;
// [ 24] (0) MCNTRL software access pending commands FIFO is half full
u32
:
24
;
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_status_mcntrl_ps_t
;
}
x393_status_mcntrl_ps_t
;
// Memory test channels access status
// Memory test channels access status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
struct
{
u32
frame_finished
:
1
;
// [ 25] (0) Channel completed all memory accesses
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
u32
busy
:
1
;
// [ 24] (0) Channel is busy (started and some memory accesses are pending)
u32
frame_finished
:
1
;
// [ 25] (0) Channel completed all memory accesses
u32
:
24
;
u32
busy
:
1
;
// [ 24] (0) Channel is busy (started and some memory accesses are pending)
u32
:
24
;
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_status_mcntrl_lintile_t
;
}
x393_status_mcntrl_lintile_t
;
// Memory test channels status
// Memory test channels status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
struct
{
u32
frame_finished
:
1
;
// [ 25] (0) Channel completed all memory accesses
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
u32
frame_busy
:
1
;
// [ 24] (0) Channel is busy (started and some memory accesses are pending)
u32
frame_finished
:
1
;
// [ 25] (0) Channel completed all memory accesses
u32
:
4
;
u32
frame_busy
:
1
;
// [ 24] (0) Channel is busy (started and some memory accesses are pending)
u32
page
:
4
;
// [19:16] (0) Current page number read/written through a channel (low bits)
u32
:
4
;
u32
line_unfinished
:
16
;
// [15: 0] (0) Current unfinished frame line
u32
page
:
4
;
// [19:16] (0) Current page number read/written through a channel (low bits)
u32
line_unfinished
:
16
;
// [15: 0] (0) Current unfinished frame line
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_status_mcntrl_testchn_t
;
}
x393_status_mcntrl_testchn_t
;
// Membridge channel status
// Membridge channel status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
struct
{
u32
done
:
1
;
// [ 25] (0) Membridge operation finished
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
u32
busy
:
1
;
// [ 24] (0) Membridge operation in progress
u32
done
:
1
;
// [ 25] (0) Membridge operation finished
u32
:
8
;
u32
busy
:
1
;
// [ 24] (0) Membridge operation in progress
u32
axi_arw_requested
:
8
;
// [15: 8] (0) Number of 64-bit words to be read/written over axi queued to AR/AW channels (low bits)
u32
:
8
;
u32
wresp_conf
:
8
;
// [ 7: 0] (0) Number of 64-bit words confirmed through axi b channel (low bits)
u32
axi_arw_requested
:
8
;
// [15: 8] (0) Number of 64-bit words to be read/written over axi queued to AR/AW channels (low bits)
u32
wresp_conf
:
8
;
// [ 7: 0] (0) Number of 64-bit words confirmed through axi b channel (low bits)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_status_membridge_t
;
}
x393_status_membridge_t
;
// Sensor/multiplexer I/O pins status
// Sensor/multiplexer I/O pins status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
struct
{
u32
xfpgatdo
:
1
;
// [ 25] (0) Multiplexer FPGA TDO output
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
u32
senspgmin
:
1
;
// [ 24] (0) senspgm pin state
u32
xfpgatdo
:
1
;
// [ 25] (0) Multiplexer FPGA TDO output
u32
:
8
;
u32
senspgmin
:
1
;
// [ 24] (0) senspgm pin state
u32
vact_alive
:
1
;
// [ 15] (0) VACT signal from the sensor is toggling (N/A for HiSPI)
u32
:
8
;
u32
hact_ext_alive
:
1
;
// [ 14] (0) HACT signal from the sensor is toggling (N/A for HiSPI)
u32
vact_alive
:
1
;
// [ 15] (0) VACT signal from the sensor is toggling (N/A for HiSPI)
u32
hact_alive
:
1
;
// [ 13] (0) HACT signal from the sensor (or internal) is toggling (N/A for HiSPI
u32
hact_ext_alive
:
1
;
// [ 14] (0) HACT signal from the sensor is toggling (N/A for HiSPI)
u32
locked_pxd_mmcm
:
1
;
// [ 12] (0) Sensor MMCM locked
u32
hact_alive
:
1
;
// [ 13] (0) HACT signal from the sensor (or internal) is toggling (N/A for HiSPI
u32
clkin_pxd_stopped_mmcm
:
1
;
// [ 11] (0) Sensor MMCM input clock stopped
u32
locked_pxd_mmcm
:
1
;
// [ 12] (0) Sensor MMCM locked
u32
clkfb_pxd_stopped_mmcm
:
1
;
// [ 10] (0) Sensor MMCM feedback clock stopped
u32
clkin_pxd_stopped_mmcm
:
1
;
// [ 11] (0) Sensor MMCM input clock stopped
u32
xfpgadone
:
1
;
// [ 9] (0) Multiplexer FPGA DONE output
u32
clkfb_pxd_stopped_mmcm
:
1
;
// [ 10] (0) Sensor MMCM feedback clock stopped
u32
ps_rdy
:
1
;
// [ 8] (0) Sensor MMCM phase ready
u32
xfpgadone
:
1
;
// [ 9] (0) Multiplexer FPGA DONE output
u32
ps_out
:
8
;
// [ 7: 0] (0) Sensor MMCM current phase
u32
ps_rdy
:
1
;
// [ 8] (0) Sensor MMCM phase ready
u32
ps_out
:
8
;
// [ 7: 0] (0) Sensor MMCM current phase
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_status_sens_io_t
;
}
x393_status_sens_io_t
;
// Sensor/multiplexer i2c status
// Sensor/multiplexer i2c status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
struct
{
u32
sda_in
:
1
;
// [ 25] (0) SDA pin state
u32
seq_num
:
6
;
// [31:26] (0) Sequence number
u32
scl_in
:
1
;
// [ 24] (0) SCL pin state
u32
sda_in
:
1
;
// [ 25] (0) SDA pin state
u32
:
6
;
u32
scl_in
:
1
;
// [ 24] (0) SCL pin state
u32
reset_on
:
1
;
// [ 17] (0) Reset in progress
u32
:
6
;
u32
req_clr
:
1
;
// [ 16] (0) Request for clearing fifo_wp (delay frame sync if previous is not yet sent out)
u32
reset_on
:
1
;
// [ 17] (0) Reset in progress
u32
frame_num
:
4
;
// [15:12] (0) I2C sequencer frame number
u32
req_clr
:
1
;
// [ 16] (0) Request for clearing fifo_wp (delay frame sync if previous is not yet sent out)
u32
alive_fs
:
1
;
// [ 11] (0) Sensor generated frame sync since last status update
u32
frame_num
:
4
;
// [15:12] (0) I2C sequencer frame number
u32
busy
:
1
;
// [ 10] (0) I2C sequencer busy
u32
alive_fs
:
1
;
// [ 11] (0) Sensor generated frame sync since last status update
u32
i2c_fifo_cntrl
:
1
;
// [ 9] (0) I2C FIFO byte counter (odd/even bytes)
u32
busy
:
1
;
// [ 10] (0) I2C sequencer busy
u32
i2c_fifo_nempty
:
1
;
// [ 8] (0) I2C read FIFO has data
u32
i2c_fifo_cntrl
:
1
;
// [ 9] (0) I2C FIFO byte counter (odd/even bytes)
u32
i2c_fifo_dout
:
8
;
// [ 7: 0] (0) I2c byte read from the device through FIFO
u32
i2c_fifo_nempty
:
1
;
// [ 8] (0) I2C read FIFO has data
u32
i2c_fifo_dout
:
8
;
// [ 7: 0] (0) I2c byte read from the device through FIFO
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_status_sens_i2c_t
;
}
x393_status_sens_i2c_t
;
// Command bits for test01 module (test frame memory accesses)
// Command bits for test01 module (test frame memory accesses)
typedef
struct
{
typedef
union
{
u32
suspend
:
1
;
// [ 2] (0) Suspend command
struct
{
u32
next_page
:
1
;
// [ 1] (0) Next page command
u32
:
29
;
u32
frame_start
:
1
;
// [ 0] (0) start frame command
u32
suspend
:
1
;
// [ 2] (0) Suspend command
u32
next_page
:
1
;
// [ 1] (0) Next page command
u32
frame_start
:
1
;
// [ 0] (0) start frame command
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_test01_mode_t
;
}
x393_test01_mode_t
;
// Command for membridge
// Command for membridge
typedef
struct
{
typedef
union
{
u32
start_reset
:
2
;
// [ 2: 1] (0) 1 - start (from current address), 3 - start from reset address
struct
{
u32
enable
:
1
;
// [ 0] (0) enable membridge
u32
:
29
;
u32
start_reset
:
2
;
// [ 2: 1] (0) 1 - start (from current address), 3 - start from reset address
u32
enable
:
1
;
// [ 0] (0) enable membridge
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_membridge_cmd_t
;
}
x393_membridge_cmd_t
;
// Cache mode for membridge
// Cache mode for membridge
typedef
struct
{
typedef
union
{
u32
debug_cache
:
1
;
// [ 4] (0) 0 - normal operation, 1 debug (replace data)
struct
{
u32
axi_cache
:
4
;
// [ 3: 0] (3) AXI CACHE value (ignored by Zynq)
u32
:
27
;
u32
debug_cache
:
1
;
// [ 4] (0) 0 - normal operation, 1 debug (replace data)
u32
axi_cache
:
4
;
// [ 3: 0] (3) AXI CACHE value (ignored by Zynq)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_membridge_mode_t
;
}
x393_membridge_mode_t
;
// Address in 64-bit words
// Address in 64-bit words
typedef
struct
{
typedef
union
{
u32
addr64
:
29
;
// [28: 0] (0) Address/length in 64-bit words (<<3 to get byte address
struct
{
u32
:
3
;
u32
addr64
:
29
;
// [28: 0] (0) Address/length in 64-bit words (<<3 to get byte address
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
u29_t
;
}
u29_t
;
// I2C contol/table data
// I2C contol/table data
...
@@ -280,77 +418,140 @@ typedef union {
...
@@ -280,77 +418,140 @@ typedef union {
u32
sda_release
:
1
;
// [ 1] (0) Release SDA early if next bit ==1 (valid with drive_ctl)
u32
sda_release
:
1
;
// [ 1] (0) Release SDA early if next bit ==1 (valid with drive_ctl)
u32
sda_drive_high
:
1
;
// [ 0] (0) Actively drive SDA high during second half of SCL==1 (valid with drive_ctl)
u32
sda_drive_high
:
1
;
// [ 0] (0) Actively drive SDA high during second half of SCL==1 (valid with drive_ctl)
}
struct_3
;
}
struct_3
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_4
;
}
x393_i2c_ctltbl_t
;
}
x393_i2c_ctltbl_t
;
// Write sensor channel mode register
// Write sensor channel mode register
typedef
struct
{
typedef
union
{
u32
bit16
:
1
;
// [ 9] (0) 0 - 8 bpp mode, 1 - 16 bpp (bypass gamma). Gamma-processed data is still used for histograms
struct
{
u32
chn_en
:
1
;
// [ 8] (1) Enable this sensor channel
u32
:
22
;
u32
hist_nrst
:
4
;
// [ 7: 4] (0xf) Reset off for histograms subchannels (may be less than 4)
u32
bit16
:
1
;
// [ 9] (0) 0 - 8 bpp mode, 1 - 16 bpp (bypass gamma). Gamma-processed data is still used for histograms
u32
hist_en
:
4
;
// [ 3: 0] (0xf) Enable subchannel histogram modules (may be less than 4)
u32
chn_en
:
1
;
// [ 8] (1) Enable this sensor channel
u32
hist_nrst
:
4
;
// [ 7: 4] (0xf) Reset off for histograms subchannels (may be less than 4)
u32
hist_en
:
4
;
// [ 3: 0] (0xf) Enable subchannel histogram modules (may be less than 4)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_sens_mode_t
;
}
x393_sens_mode_t
;
// Write number of sensor frames to combine into one virtual (linescan mode)
// Write number of sensor frames to combine into one virtual (linescan mode)
typedef
struct
{
typedef
union
{
u32
mult_frames
:
16
;
// [15: 0] (0) Number of frames to combine into one minus 1 (0 - single,1 - two frames...)
struct
{
u32
:
16
;
u32
mult_frames
:
16
;
// [15: 0] (0) Number of frames to combine into one minus 1 (0 - single,1 - two frames...)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_sens_sync_mult_t
;
}
x393_sens_sync_mult_t
;
// Write sensor number of lines to delay frame sync
// Write sensor number of lines to delay frame sync
typedef
struct
{
typedef
union
{
u32
mult_frames
:
16
;
// [15: 0] (0) Number of lines to delay late frame sync
struct
{
u32
:
16
;
u32
mult_frames
:
16
;
// [15: 0] (0) Number of lines to delay late frame sync
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_sens_sync_late_t
;
}
x393_sens_sync_late_t
;
// Configure memory controller priorities
// Configure memory controller priorities
typedef
struct
{
typedef
union
{
u32
priority
:
16
;
// [15: 0] (0) Channel priority (the larger the higher)
struct
{
u32
:
16
;
u32
priority
:
16
;
// [15: 0] (0) Channel priority (the larger the higher)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_arbite_pri_t
;
}
x393_arbite_pri_t
;
// Enable/disable memory controller channels
// Enable/disable memory controller channels
typedef
struct
{
typedef
union
{
u32
chn_en
:
16
;
// [15: 0] (0) Enabled memory channels
struct
{
u32
:
16
;
u32
chn_en
:
16
;
// [15: 0] (0) Enabled memory channels
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntr_chn_en_t
;
}
x393_mcntr_chn_en_t
;
// DQS and DQM patterns (DQM - 0, DQS 0xaa or 0x55)
// DQS and DQM patterns (DQM - 0, DQS 0xaa or 0x55)
typedef
struct
{
typedef
union
{
u32
dqm_patt
:
8
;
// [15: 8] (0) DQM pattern: 0x0
struct
{
u32
dqs_patt
:
8
;
// [ 7: 0] (0xaa) DQS pattern: 0xaa/0x55
u32
:
16
;
u32
dqm_patt
:
8
;
// [15: 8] (0) DQM pattern: 0x0
u32
dqs_patt
:
8
;
// [ 7: 0] (0xaa) DQS pattern: 0xaa/0x55
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntr_dqs_dqm_patt_t
;
}
x393_mcntr_dqs_dqm_patt_t
;
// DQ and DQS tristate control when turning on and off
// DQ and DQS tristate control when turning on and off
typedef
struct
{
typedef
union
{
u32
dqs_tri_last
:
4
;
// [15:12] (0xc) DQS tristate end (0xe,0xc,0x8); early, nominal, late
struct
{
u32
dqs_tri_first
:
4
;
// [11: 8] (1) DQS tristate start (0x1,0x3,0x7); early, nominal, late
u32
:
16
;
u32
dq_tri_last
:
4
;
// [ 7: 4] (0xe) DQ tristate end (0xf,0xe,0xc); early, nominal, late
u32
dqs_tri_last
:
4
;
// [15:12] (0xc) DQS tristate end (0xe,0xc,0x8); early, nominal, late
u32
dq_tri_first
:
4
;
// [ 3: 0] (3) DQ tristate start (0x3,0x7,0xf); early, nominal, late
u32
dqs_tri_first
:
4
;
// [11: 8] (1) DQS tristate start (0x1,0x3,0x7); early, nominal, late
u32
dq_tri_last
:
4
;
// [ 7: 4] (0xe) DQ tristate end (0xf,0xe,0xc); early, nominal, late
u32
dq_tri_first
:
4
;
// [ 3: 0] (3) DQ tristate start (0x3,0x7,0xf); early, nominal, late
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mcntr_dqs_dqm_tri_t
;
}
x393_mcntr_dqs_dqm_tri_t
;
// DDR3 memory controller I/O delay
// DDR3 memory controller I/O delay
typedef
struct
{
typedef
union
{
u32
dly
:
8
;
// [ 7: 0] (0) 8-bit delay value: 5MSBs(0..31) and 3LSBs(0..4)
struct
{
u32
:
24
;
u32
dly
:
8
;
// [ 7: 0] (0) 8-bit delay value: 5MSBs(0..31) and 3LSBs(0..4)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_dly_t
;
}
x393_dly_t
;
// Extra delay in mclk (fDDR/2) cycles) to data write buffer
// Extra delay in mclk (fDDR/2) cycles) to data write buffer
typedef
struct
{
typedef
union
{
u32
wbuf_dly
:
4
;
// [ 3: 0] (9) Extra delay in mclk (fDDR/2) cycles) to data write buffer
struct
{
u32
:
28
;
u32
wbuf_dly
:
4
;
// [ 3: 0] (9) Extra delay in mclk (fDDR/2) cycles) to data write buffer
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_wbuf_dly_t
;
}
x393_wbuf_dly_t
;
// Control for the gamma-conversion module
// Control for the gamma-conversion module
typedef
struct
{
typedef
union
{
u32
trig
:
1
;
// [ 5] (0) Single trigger used when repetitive mode is off (self clearing bit)
struct
{
u32
repet
:
1
;
// [ 4] (1) Repetitive (normal) mode. Set 0 for testing of the single-frame mode
u32
:
26
;
u32
en
:
1
;
// [ 3] (1) Enable module
u32
trig
:
1
;
// [ 5] (0) Single trigger used when repetitive mode is off (self clearing bit)
u32
page
:
1
;
// [ 2] (0) Table page (only available if SENS_GAMMA_BUFFER in Verilog)
u32
repet
:
1
;
// [ 4] (1) Repetitive (normal) mode. Set 0 for testing of the single-frame mode
u32
bayer
:
2
;
// [ 1: 0] (0) Bayer color shift (pixel to gamma table)
u32
en
:
1
;
// [ 3] (1) Enable module
u32
page
:
1
;
// [ 2] (0) Table page (only available if SENS_GAMMA_BUFFER in Verilog)
u32
bayer
:
2
;
// [ 1: 0] (0) Bayer color shift (pixel to gamma table)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_gamma_ctl_t
;
}
x393_gamma_ctl_t
;
// Write gamma table address/data
// Write gamma table address/data
...
@@ -370,19 +571,33 @@ typedef union {
...
@@ -370,19 +571,33 @@ typedef union {
char
diff
:
7
;
// [16:10] (0) Difference to next (signed, -64..+63)
char
diff
:
7
;
// [16:10] (0) Difference to next (signed, -64..+63)
u32
base
:
10
;
// [ 9: 0] (0) Knee point value (to be interpolated between)
u32
base
:
10
;
// [ 9: 0] (0) Knee point value (to be interpolated between)
}
struct_1
;
}
struct_1
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_2
;
}
x393_gamma_tbl_t
;
}
x393_gamma_tbl_t
;
// Heights of the first two subchannels frames
// Heights of the first two subchannels frames
typedef
struct
{
typedef
union
{
u32
height1m1
:
16
;
// [31:16] (0) Height of subchannel 1 frame minus 1
struct
{
u32
height0m1
:
16
;
// [15: 0] (0) Height of subchannel 0 frame minus 1
u32
height1m1
:
16
;
// [31:16] (0) Height of subchannel 1 frame minus 1
u32
height0m1
:
16
;
// [15: 0] (0) Height of subchannel 0 frame minus 1
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_gamma_height01m1_t
;
}
x393_gamma_height01m1_t
;
// Height of the third subchannel frame
// Height of the third subchannel frame
typedef
struct
{
typedef
union
{
u32
height2m1
:
16
;
// [15: 0] (0) Height of subchannel 2 frame minus 1
struct
{
u32
:
16
;
u32
height2m1
:
16
;
// [15: 0] (0) Height of subchannel 2 frame minus 1
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_gamma_height2m1_t
;
}
x393_gamma_height2m1_t
;
// Sensor port I/O control
// Sensor port I/O control
...
@@ -425,21 +640,30 @@ typedef union {
...
@@ -425,21 +640,30 @@ typedef union {
u32
mrst_set
:
1
;
// [ 1] (0) when set to 1, MRST is set to the 'mrst' field value
u32
mrst_set
:
1
;
// [ 1] (0) when set to 1, MRST is set to the 'mrst' field value
u32
mrst
:
1
;
// [ 0] (0) MRST signal level to the sensor (0 - low(active), 1 - high (inactive)
u32
mrst
:
1
;
// [ 0] (0) MRST signal level to the sensor (0 - low(active), 1 - high (inactive)
}
struct_1
;
}
struct_1
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_2
;
}
x393_sensio_ctl_t
;
}
x393_sensio_ctl_t
;
// Programming interface for multiplexer FPGA
// Programming interface for multiplexer FPGA
typedef
struct
{
typedef
union
{
u32
pgmen_set
:
1
;
// [ 9] (0) Sensor port PGMEN set to 'pgmen' field
struct
{
u32
pgmen
:
1
;
// [ 8] (0) Sensor port PGMEN level
u32
:
22
;
u32
prog_set
:
1
;
// [ 7] (0) Sensor port PROG set to 'prog' field
u32
pgmen_set
:
1
;
// [ 9] (0) Sensor port PGMEN set to 'pgmen' field
u32
prog
:
1
;
// [ 6] (0) Sensor port PROG level
u32
pgmen
:
1
;
// [ 8] (0) Sensor port PGMEN level
u32
tck_set
:
1
;
// [ 5] (0) JTAG TCK set to 'tck' field
u32
prog_set
:
1
;
// [ 7] (0) Sensor port PROG set to 'prog' field
u32
tck
:
1
;
// [ 4] (0) JTAG TCK level
u32
prog
:
1
;
// [ 6] (0) Sensor port PROG level
u32
tms_set
:
1
;
// [ 3] (0) JTAG TMS set to 'tms' field
u32
tck_set
:
1
;
// [ 5] (0) JTAG TCK set to 'tck' field
u32
tms
:
1
;
// [ 2] (0) JTAG TMS level
u32
tck
:
1
;
// [ 4] (0) JTAG TCK level
u32
tdi_set
:
1
;
// [ 1] (0) JTAG TDI set to 'tdi' field
u32
tms_set
:
1
;
// [ 3] (0) JTAG TMS set to 'tms' field
u32
tdi
:
1
;
// [ 0] (0) JTAG TDI level
u32
tms
:
1
;
// [ 2] (0) JTAG TMS level
u32
tdi_set
:
1
;
// [ 1] (0) JTAG TDI set to 'tdi' field
u32
tdi
:
1
;
// [ 0] (0) JTAG TDI level
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_sensio_jpag_t
;
}
x393_sensio_jpag_t
;
// Sensor i/o timing register 0 (different meanings for different sensor types)
// Sensor i/o timing register 0 (different meanings for different sensor types)
...
@@ -455,6 +679,9 @@ typedef union {
...
@@ -455,6 +679,9 @@ typedef union {
u32
:
28
;
u32
:
28
;
u32
fifo_lag
:
4
;
// [ 3: 0] (7) FIFO delay to start output
u32
fifo_lag
:
4
;
// [ 3: 0] (7) FIFO delay to start output
}
struct_1
;
}
struct_1
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_2
;
}
x393_sensio_tim0_t
;
}
x393_sensio_tim0_t
;
// Sensor i/o timing register 1 (different meanings for different sensor types)
// Sensor i/o timing register 1 (different meanings for different sensor types)
...
@@ -473,6 +700,9 @@ typedef union {
...
@@ -473,6 +700,9 @@ typedef union {
u32
phys_lane1
:
2
;
// [ 3: 2] (2) Physical lane for logical lane 1
u32
phys_lane1
:
2
;
// [ 3: 2] (2) Physical lane for logical lane 1
u32
phys_lane0
:
2
;
// [ 1: 0] (1) Physical lane for logical lane 0
u32
phys_lane0
:
2
;
// [ 1: 0] (1) Physical lane for logical lane 0
}
struct_1
;
}
struct_1
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_2
;
}
x393_sensio_tim1_t
;
}
x393_sensio_tim1_t
;
// Sensor i/o timing register 2 (different meanings for different sensor types)
// Sensor i/o timing register 2 (different meanings for different sensor types)
...
@@ -490,6 +720,9 @@ typedef union {
...
@@ -490,6 +720,9 @@ typedef union {
u32
dly_lane1
:
8
;
// [15: 8] (0) lane 1 (phys) input delay (3 LSB not used)
u32
dly_lane1
:
8
;
// [15: 8] (0) lane 1 (phys) input delay (3 LSB not used)
u32
dly_lane0
:
8
;
// [ 7: 0] (0) lane 0 (phys) input delay (3 LSB not used)
u32
dly_lane0
:
8
;
// [ 7: 0] (0) lane 0 (phys) input delay (3 LSB not used)
}
struct_1
;
}
struct_1
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_2
;
}
x393_sensio_tim2_t
;
}
x393_sensio_tim2_t
;
// Sensor i/o timing register 3 (different meanings for different sensor types)
// Sensor i/o timing register 3 (different meanings for different sensor types)
...
@@ -505,12 +738,21 @@ typedef union {
...
@@ -505,12 +738,21 @@ typedef union {
u32
:
24
;
u32
:
24
;
u32
phase_h
:
8
;
// [ 7: 0] (0) MMCM phase
u32
phase_h
:
8
;
// [ 7: 0] (0) MMCM phase
}
struct_1
;
}
struct_1
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_2
;
}
x393_sensio_tim3_t
;
}
x393_sensio_tim3_t
;
// Set sensor frame width (0 - use received)
// Set sensor frame width (0 - use received)
typedef
struct
{
typedef
union
{
u32
sensor_width
:
16
;
// [15: 0] (0) Sensor frame width (0 - use line sync signals from the sensor)
struct
{
u32
:
16
;
u32
sensor_width
:
16
;
// [15: 0] (0) Sensor frame width (0 - use line sync signals from the sensor)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_sensio_width_t
;
}
x393_sensio_width_t
;
// Lens vignetting parameter (write address first, then data that may overlap som address bits)
// Lens vignetting parameter (write address first, then data that may overlap som address bits)
...
@@ -558,288 +800,456 @@ typedef union {
...
@@ -558,288 +800,456 @@ typedef union {
u32
:
28
;
u32
:
28
;
u32
post_scale
:
4
;
// [ 3: 0] (1) Shift result (bits)
u32
post_scale
:
4
;
// [ 3: 0] (1) Shift result (bits)
}
struct_9
;
}
struct_9
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_10
;
}
x393_lens_corr_t
;
}
x393_lens_corr_t
;
// Height of the subchannel frame for vignetting correction
// Height of the subchannel frame for vignetting correction
typedef
struct
{
typedef
union
{
u32
height_m1
:
16
;
// [15: 0] (0) Height of subframe minus 1
struct
{
u32
:
16
;
u32
height_m1
:
16
;
// [15: 0] (0) Height of subframe minus 1
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_lens_height_m1_t
;
}
x393_lens_height_m1_t
;
// Histogram window left/top margins
// Histogram window left/top margins
typedef
struct
{
typedef
union
{
u32
top
:
16
;
// [31:16] (0) Histogram window top margin
struct
{
u32
left
:
16
;
// [15: 0] (0) Histogram window left margin
u32
top
:
16
;
// [31:16] (0) Histogram window top margin
u32
left
:
16
;
// [15: 0] (0) Histogram window left margin
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_hist_left_top_t
;
}
x393_hist_left_top_t
;
// Histogram window width and height minus 1 (0 use full)
// Histogram window width and height minus 1 (0 use full)
typedef
struct
{
typedef
union
{
u32
height_m1
:
16
;
// [31:16] (0) Height of he histogram window minus 1. If 0 - use frame bottom margin (end of VACT)
struct
{
u32
width_m1
:
16
;
// [15: 0] (0) Width of the histogram window minus 1. If 0 - use frame right margin (end of HACT)
u32
height_m1
:
16
;
// [31:16] (0) Height of he histogram window minus 1. If 0 - use frame bottom margin (end of VACT)
u32
width_m1
:
16
;
// [15: 0] (0) Width of the histogram window minus 1. If 0 - use frame right margin (end of HACT)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_hist_width_height_m1_t
;
}
x393_hist_width_height_m1_t
;
// Histograms DMA mode
// Histograms DMA mode
typedef
struct
{
typedef
union
{
u32
cache
:
4
;
// [ 7: 4] (3) AXI cache mode (normal - 3), ignored by Zynq?
struct
{
u32
:
1
;
u32
:
24
;
u32
confirm
:
1
;
// [ 2] (1) 1 - wait for confirmation that histogram was written to the system memory
u32
cache
:
4
;
// [ 7: 4] (3) AXI cache mode (normal - 3), ignored by Zynq?
u32
nrst
:
1
;
// [ 1] (1) 0 - reset histograms DMA
u32
:
1
;
u32
en
:
1
;
// [ 0] (1) Enable histograms DMA
u32
confirm
:
1
;
// [ 2] (1) 1 - wait for confirmation that histogram was written to the system memory
u32
nrst
:
1
;
// [ 1] (1) 0 - reset histograms DMA
u32
en
:
1
;
// [ 0] (1) Enable histograms DMA
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_hist_saxi_mode_t
;
}
x393_hist_saxi_mode_t
;
// Histograms DMA addresses
// Histograms DMA addresses
typedef
struct
{
typedef
union
{
u32
page
:
20
;
// [19: 0] (0) Start address of the subchannel histogram (in pages = 4096 bytes
struct
{
u32
:
12
;
u32
page
:
20
;
// [19: 0] (0) Start address of the subchannel histogram (in pages = 4096 bytes
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_hist_saxi_addr_t
;
}
x393_hist_saxi_addr_t
;
// Compressor mode control
// Compressor mode control
typedef
struct
{
typedef
union
{
u32
focus_set
:
1
;
// [ 23] (0) Set 'focus'
struct
{
u32
focus
:
2
;
// [22:21] (0) Focus mode
u32
:
8
;
u32
bayer_set
:
1
;
// [ 20] (0) Set 'bayer'
u32
focus_set
:
1
;
// [ 23] (0) Set 'focus'
u32
bayer
:
2
;
// [19:18] (0) Bayer shift
u32
focus
:
2
;
// [22:21] (0) Focus mode
u32
:
2
;
u32
bayer_set
:
1
;
// [ 20] (0) Set 'bayer'
u32
multiframe_set
:
1
;
// [ 15] (0) Set 'multiframe'
u32
bayer
:
2
;
// [19:18] (0) Bayer shift
u32
multiframe
:
1
;
// [ 14] (0) Multi/single frame mode
u32
:
2
;
u32
cmode_set
:
1
;
// [ 13] (0) Set 'cmode'
u32
multiframe_set
:
1
;
// [ 15] (0) Set 'multiframe'
u32
cmode
:
4
;
// [12: 9] (0) Color format
u32
multiframe
:
1
;
// [ 14] (0) Multi/single frame mode
u32
dcsub_set
:
1
;
// [ 8] (0) Set 'qbank'
u32
cmode_set
:
1
;
// [ 13] (0) Set 'cmode'
u32
dcsub
:
1
;
// [ 7] (0) Subtract DC enable
u32
cmode
:
4
;
// [12: 9] (0) Color format
u32
qbank_set
:
1
;
// [ 6] (0) Set 'qbank'
u32
dcsub_set
:
1
;
// [ 8] (0) Set 'qbank'
u32
qbank
:
3
;
// [ 5: 3] (0) Quantization table bank
u32
dcsub
:
1
;
// [ 7] (0) Subtract DC enable
u32
run_set
:
1
;
// [ 2] (0) Set 'run'
u32
qbank_set
:
1
;
// [ 6] (0) Set 'qbank'
u32
run
:
2
;
// [ 1: 0] (0) Run mode
u32
qbank
:
3
;
// [ 5: 3] (0) Quantization table bank
u32
run_set
:
1
;
// [ 2] (0) Set 'run'
u32
run
:
2
;
// [ 1: 0] (0) Run mode
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_cmprs_mode_t
;
}
x393_cmprs_mode_t
;
// Compressor coring mode (table number)
// Compressor coring mode (table number)
typedef
struct
{
typedef
union
{
u32
coring_table
:
3
;
// [ 2: 0] (0) Select coring table pair number
struct
{
u32
:
29
;
u32
coring_table
:
3
;
// [ 2: 0] (0) Select coring table pair number
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_cmprs_coring_mode_t
;
}
x393_cmprs_coring_mode_t
;
// Compressor color saturation
// Compressor color saturation
typedef
struct
{
typedef
union
{
u32
colorsat_red
:
10
;
// [21:12] (0x16c) Color saturation for red (0xb6 - 100%)
struct
{
u32
:
2
;
u32
:
10
;
u32
colorsat_blue
:
10
;
// [ 9: 0] (0x120) Color saturation for blue (0x90 - 100%)
u32
colorsat_red
:
10
;
// [21:12] (0x16c) Color saturation for red (0xb6 - 100%)
u32
:
2
;
u32
colorsat_blue
:
10
;
// [ 9: 0] (0x120) Color saturation for blue (0x90 - 100%)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_cmprs_colorsat_t
;
}
x393_cmprs_colorsat_t
;
// Compressor frame format
// Compressor frame format
typedef
struct
{
typedef
union
{
u32
left_margin
:
5
;
// [30:26] (0) Left margin of the first pixel (0..31) for 32-pixel wide colums in memory access
struct
{
u32
num_macro_rows_m1
:
13
;
// [25:13] (0) Number of macroblock rows minus 1
u32
:
1
;
u32
num_macro_cols_m1
:
13
;
// [12: 0] (0) Number of macroblock colums minus 1
u32
left_margin
:
5
;
// [30:26] (0) Left margin of the first pixel (0..31) for 32-pixel wide colums in memory access
u32
num_macro_rows_m1
:
13
;
// [25:13] (0) Number of macroblock rows minus 1
u32
num_macro_cols_m1
:
13
;
// [12: 0] (0) Number of macroblock colums minus 1
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_cmprs_frame_format_t
;
}
x393_cmprs_frame_format_t
;
// Compressor interrupts control
// Compressor interrupts control
typedef
struct
{
typedef
union
{
u32
interrupt_cmd
:
2
;
// [ 1: 0] (0) 0: nop, 1: clear interrupt status, 2: disable interrupt, 3: enable interrupt
struct
{
u32
:
30
;
u32
interrupt_cmd
:
2
;
// [ 1: 0] (0) 0: nop, 1: clear interrupt status, 2: disable interrupt, 3: enable interrupt
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_cmprs_interrupts_t
;
}
x393_cmprs_interrupts_t
;
// Compressor tables load control
// Compressor tables load control
typedef
struct
{
typedef
union
{
u32
type
:
2
;
// [25:24] (0) 0: quantization, 1: coring, 2: focus, 3: huffman
struct
{
u32
addr32
:
24
;
// [23: 0] (0) Table address to start writing to (autoincremented) for DWORDs
u32
:
6
;
u32
type
:
2
;
// [25:24] (0) 0: quantization, 1: coring, 2: focus, 3: huffman
u32
addr32
:
24
;
// [23: 0] (0) Table address to start writing to (autoincremented) for DWORDs
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_cmprs_table_addr_t
;
}
x393_cmprs_table_addr_t
;
// Compressor DMA buffer address (in 32-byte blocks)
// Compressor DMA buffer address (in 32-byte blocks)
typedef
struct
{
typedef
union
{
u32
sa256
:
27
;
// [26: 0] (0) System memory buffer start in multiples of 32 bytes (256 bits)
struct
{
u32
:
5
;
u32
sa256
:
27
;
// [26: 0] (0) System memory buffer start in multiples of 32 bytes (256 bits)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_afimux_sa_t
;
}
x393_afimux_sa_t
;
// Compressor DMA buffer length (in 32-byte blocks)
// Compressor DMA buffer length (in 32-byte blocks)
typedef
struct
{
typedef
union
{
u32
len256
:
27
;
// [26: 0] (0) System memory buffer length in multiples of 32 bytes (256 bits)
struct
{
u32
:
5
;
u32
len256
:
27
;
// [26: 0] (0) System memory buffer length in multiples of 32 bytes (256 bits)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_afimux_len_t
;
}
x393_afimux_len_t
;
// Compressor DMA channels reset
// Compressor DMA channels reset
typedef
struct
{
typedef
union
{
u32
rst3
:
1
;
// [ 3] (0) AXI HPx sub-channel0 reset (0 - normal operation, 1 - reset)
struct
{
u32
rst2
:
1
;
// [ 2] (0) AXI HPx sub-channel0 reset (0 - normal operation, 1 - reset)
u32
:
28
;
u32
rst1
:
1
;
// [ 1] (0) AXI HPx sub-channel0 reset (0 - normal operation, 1 - reset)
u32
rst3
:
1
;
// [ 3] (0) AXI HPx sub-channel0 reset (0 - normal operation, 1 - reset)
u32
rst0
:
1
;
// [ 0] (0) AXI HPx sub-channel0 reset (0 - normal operation, 1 - reset)
u32
rst2
:
1
;
// [ 2] (0) AXI HPx sub-channel0 reset (0 - normal operation, 1 - reset)
u32
rst1
:
1
;
// [ 1] (0) AXI HPx sub-channel0 reset (0 - normal operation, 1 - reset)
u32
rst0
:
1
;
// [ 0] (0) AXI HPx sub-channel0 reset (0 - normal operation, 1 - reset)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_afimux_rst_t
;
}
x393_afimux_rst_t
;
// Compressor DMA enable (global and channels)
// Compressor DMA enable (global and channels)
typedef
struct
{
typedef
union
{
u32
en_set
:
1
;
// [ 9] (0) 0 - nop, 1 - set en
struct
{
u32
en
:
1
;
// [ 8] (0) AXI HPx global enable value to set (0 - pause, 1 - run)
u32
:
22
;
u32
en3_set
:
1
;
// [ 7] (0) 0 - nop, 1 - set en3
u32
en_set
:
1
;
// [ 9] (0) 0 - nop, 1 - set en
u32
en3
:
1
;
// [ 6] (0) AXI HPx sub-channel3 enable value to set (0 - pause, 1 - run)
u32
en
:
1
;
// [ 8] (0) AXI HPx global enable value to set (0 - pause, 1 - run)
u32
en2_set
:
1
;
// [ 5] (0) 0 - nop, 1 - set en2
u32
en3_set
:
1
;
// [ 7] (0) 0 - nop, 1 - set en3
u32
en2
:
1
;
// [ 4] (0) AXI HPx sub-channel2 enable value to set (0 - pause, 1 - run)
u32
en3
:
1
;
// [ 6] (0) AXI HPx sub-channel3 enable value to set (0 - pause, 1 - run)
u32
en1_set
:
1
;
// [ 3] (0) 0 - nop, 1 - set en1
u32
en2_set
:
1
;
// [ 5] (0) 0 - nop, 1 - set en2
u32
en1
:
1
;
// [ 2] (0) AXI HPx sub-channel1 enable value to set (0 - pause, 1 - run)
u32
en2
:
1
;
// [ 4] (0) AXI HPx sub-channel2 enable value to set (0 - pause, 1 - run)
u32
en0_set
:
1
;
// [ 1] (0) 0 - nop, 1 - set en0
u32
en1_set
:
1
;
// [ 3] (0) 0 - nop, 1 - set en1
u32
en0
:
1
;
// [ 0] (0) AXI HPx sub-channel0 enable value to set (0 - pause, 1 - run)
u32
en1
:
1
;
// [ 2] (0) AXI HPx sub-channel1 enable value to set (0 - pause, 1 - run)
u32
en0_set
:
1
;
// [ 1] (0) 0 - nop, 1 - set en0
u32
en0
:
1
;
// [ 0] (0) AXI HPx sub-channel0 enable value to set (0 - pause, 1 - run)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_afimux_en_t
;
}
x393_afimux_en_t
;
// Compressor DMA report mode
// Compressor DMA report mode
typedef
struct
{
typedef
union
{
u32
mode3_set
:
1
;
// [ 14] (0) 0 - nop, 1 - set mode0
struct
{
u32
mode3
:
2
;
// [13:12] (0) channel0 report mode: 0 - EOF int, 1 - EOF confirmed, 2 - CP (current), 3 - CP confirmed
u32
:
17
;
u32
:
1
;
u32
mode3_set
:
1
;
// [ 14] (0) 0 - nop, 1 - set mode0
u32
mode2_set
:
1
;
// [ 10] (0) 0 - nop, 1 - set mode0
u32
mode3
:
2
;
// [13:12] (0) channel0 report mode: 0 - EOF int, 1 - EOF confirmed, 2 - CP (current), 3 - CP confirmed
u32
mode2
:
2
;
// [ 9: 8] (0) channel0 report mode: 0 - EOF int, 1 - EOF confirmed, 2 - CP (current), 3 - CP confirmed
u32
:
1
;
u32
:
1
;
u32
mode2_set
:
1
;
// [ 10] (0) 0 - nop, 1 - set mode0
u32
mode1_set
:
1
;
// [ 6] (0) 0 - nop, 1 - set mode0
u32
mode2
:
2
;
// [ 9: 8] (0) channel0 report mode: 0 - EOF int, 1 - EOF confirmed, 2 - CP (current), 3 - CP confirmed
u32
mode1
:
2
;
// [ 5: 4] (0) channel0 report mode: 0 - EOF int, 1 - EOF confirmed, 2 - CP (current), 3 - CP confirmed
u32
:
1
;
u32
:
1
;
u32
mode1_set
:
1
;
// [ 6] (0) 0 - nop, 1 - set mode0
u32
mode0_set
:
1
;
// [ 2] (0) 0 - nop, 1 - set mode0
u32
mode1
:
2
;
// [ 5: 4] (0) channel0 report mode: 0 - EOF int, 1 - EOF confirmed, 2 - CP (current), 3 - CP confirmed
u32
mode0
:
2
;
// [ 1: 0] (0) channel0 report mode: 0 - EOF int, 1 - EOF confirmed, 2 - CP (current), 3 - CP confirmed
u32
:
1
;
u32
mode0_set
:
1
;
// [ 2] (0) 0 - nop, 1 - set mode0
u32
mode0
:
2
;
// [ 1: 0] (0) channel0 report mode: 0 - EOF int, 1 - EOF confirmed, 2 - CP (current), 3 - CP confirmed
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_afimux_report_t
;
}
x393_afimux_report_t
;
// Compressor DMA status
// Compressor DMA status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
struct
{
u32
offset256
:
26
;
// [25: 0] (0) AFI MUX current/EOF pointer offset in 32-byte blocks
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
u32
offset256
:
26
;
// [25: 0] (0) AFI MUX current/EOF pointer offset in 32-byte blocks
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_afimux_status_t
;
}
x393_afimux_status_t
;
// GPIO output control
// GPIO output control
typedef
struct
{
typedef
union
{
u32
chn_c
:
2
;
// [31:30] (0) Enable C channel (logger): 0,1 - nop, 2 - disab;e, 3 - enable
struct
{
u32
chn_b
:
2
;
// [29:28] (0) Enable B channel (reserved): 0,1 - nop, 2 - disab;e, 3 - enable
u32
chn_c
:
2
;
// [31:30] (0) Enable C channel (logger): 0,1 - nop, 2 - disab;e, 3 - enable
u32
chn_a
:
2
;
// [27:26] (0) Enable A channel (camsync): 0,1 - nop, 2 - disab;e, 3 - enable
u32
chn_b
:
2
;
// [29:28] (0) Enable B channel (reserved): 0,1 - nop, 2 - disab;e, 3 - enable
u32
soft
:
2
;
// [25:24] (0) Enable pin software control: 0,1 - nop, 2 - disab;e, 3 - enable
u32
chn_a
:
2
;
// [27:26] (0) Enable A channel (camsync): 0,1 - nop, 2 - disab;e, 3 - enable
u32
:
4
;
u32
soft
:
2
;
// [25:24] (0) Enable pin software control: 0,1 - nop, 2 - disab;e, 3 - enable
u32
pin9
:
2
;
// [19:18] (0) Output control for pin 0: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
:
4
;
u32
pin8
:
2
;
// [17:16] (0) Output control for pin 8: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin9
:
2
;
// [19:18] (0) Output control for pin 0: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin7
:
2
;
// [15:14] (0) Output control for pin 7: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin8
:
2
;
// [17:16] (0) Output control for pin 8: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin6
:
2
;
// [13:12] (0) Output control for pin 6: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin7
:
2
;
// [15:14] (0) Output control for pin 7: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin5
:
2
;
// [11:10] (0) Output control for pin 5: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin6
:
2
;
// [13:12] (0) Output control for pin 6: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin4
:
2
;
// [ 9: 8] (0) Output control for pin 4: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin5
:
2
;
// [11:10] (0) Output control for pin 5: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin3
:
2
;
// [ 7: 6] (0) Output control for pin 3: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin4
:
2
;
// [ 9: 8] (0) Output control for pin 4: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin2
:
2
;
// [ 5: 4] (0) Output control for pin 2: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin3
:
2
;
// [ 7: 6] (0) Output control for pin 3: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin1
:
2
;
// [ 3: 2] (0) Output control for pin 1: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin2
:
2
;
// [ 5: 4] (0) Output control for pin 2: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin0
:
2
;
// [ 1: 0] (0) Output control for pin 0: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin1
:
2
;
// [ 3: 2] (0) Output control for pin 1: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
u32
pin0
:
2
;
// [ 1: 0] (0) Output control for pin 0: 0 - nop, 1 - set low, 2 - set high, 3 - tristate
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_gpio_set_pins_t
;
}
x393_gpio_set_pins_t
;
// GPIO pins status
// GPIO pins status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
struct
{
u32
:
16
;
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
u32
pin9
:
1
;
// [ 9] (0) GPIO pin 0 state
u32
:
16
;
u32
pin8
:
1
;
// [ 8] (0) GPIO pin 0 state
u32
pin9
:
1
;
// [ 9] (0) GPIO pin 0 state
u32
pin7
:
1
;
// [ 7] (0) GPIO pin 0 state
u32
pin8
:
1
;
// [ 8] (0) GPIO pin 0 state
u32
pin6
:
1
;
// [ 6] (0) GPIO pin 0 state
u32
pin7
:
1
;
// [ 7] (0) GPIO pin 0 state
u32
pin5
:
1
;
// [ 5] (0) GPIO pin 0 state
u32
pin6
:
1
;
// [ 6] (0) GPIO pin 0 state
u32
pin4
:
1
;
// [ 4] (0) GPIO pin 0 state
u32
pin5
:
1
;
// [ 5] (0) GPIO pin 0 state
u32
pin3
:
1
;
// [ 3] (0) GPIO pin 0 state
u32
pin4
:
1
;
// [ 4] (0) GPIO pin 0 state
u32
pin2
:
1
;
// [ 2] (0) GPIO pin 0 state
u32
pin3
:
1
;
// [ 3] (0) GPIO pin 0 state
u32
pin1
:
1
;
// [ 1] (0) GPIO pin 0 state
u32
pin2
:
1
;
// [ 2] (0) GPIO pin 0 state
u32
pin0
:
1
;
// [ 0] (0) GPIO pin 0 state
u32
pin1
:
1
;
// [ 1] (0) GPIO pin 0 state
u32
pin0
:
1
;
// [ 0] (0) GPIO pin 0 state
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_gpio_status_t
;
}
x393_gpio_status_t
;
// RTC seconds
// RTC seconds
typedef
struct
{
typedef
union
{
u32
sec
:
32
;
// [31: 0] (0) RTC seconds
struct
{
u32
sec
:
32
;
// [31: 0] (0) RTC seconds
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_rtc_sec_t
;
}
x393_rtc_sec_t
;
// RTC microseconds
// RTC microseconds
typedef
struct
{
typedef
union
{
u32
usec
:
20
;
// [19: 0] (0) RTC microseconds
struct
{
u32
:
12
;
u32
usec
:
20
;
// [19: 0] (0) RTC microseconds
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_rtc_usec_t
;
}
x393_rtc_usec_t
;
// RTC correction
// RTC correction
typedef
struct
{
typedef
union
{
short
corr
:
16
;
// [15: 0] (0) RTC correction, +/1 1/256 full scale
struct
{
u32
:
16
;
short
corr
:
16
;
// [15: 0] (0) RTC correction, +/1 1/256 full scale
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_rtc_corr_t
;
}
x393_rtc_corr_t
;
// RTC status
// RTC status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
struct
{
u32
:
1
;
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
u32
alt_snap
:
1
;
// [ 24] (0) alternates 0/1 each time RTC timer makes a snapshot
u32
:
1
;
u32
:
24
;
u32
alt_snap
:
1
;
// [ 24] (0) alternates 0/1 each time RTC timer makes a snapshot
u32
:
24
;
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_rtc_status_t
;
}
x393_rtc_status_t
;
// CAMSYNC I/O configuration
// CAMSYNC I/O configuration
typedef
struct
{
typedef
union
{
u32
line9
:
2
;
// [19:18] (1) line 9 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
struct
{
u32
line8
:
2
;
// [17:16] (1) line 8 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
:
12
;
u32
line7
:
2
;
// [15:14] (1) line 7 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line9
:
2
;
// [19:18] (1) line 9 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line6
:
2
;
// [13:12] (1) line 6 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line8
:
2
;
// [17:16] (1) line 8 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line5
:
2
;
// [11:10] (1) line 5 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line7
:
2
;
// [15:14] (1) line 7 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line4
:
2
;
// [ 9: 8] (1) line 4 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line6
:
2
;
// [13:12] (1) line 6 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line3
:
2
;
// [ 7: 6] (1) line 3 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line5
:
2
;
// [11:10] (1) line 5 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line2
:
2
;
// [ 5: 4] (1) line 2 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line4
:
2
;
// [ 9: 8] (1) line 4 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line1
:
2
;
// [ 3: 2] (1) line 1 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line3
:
2
;
// [ 7: 6] (1) line 3 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line0
:
2
;
// [ 1: 0] (1) line 0 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line2
:
2
;
// [ 5: 4] (1) line 2 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line1
:
2
;
// [ 3: 2] (1) line 1 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
u32
line0
:
2
;
// [ 1: 0] (1) line 0 mode: 0 - inactive, 1 - keep (nop), 2 - active low, 3 - active high
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_camsync_io_t
;
}
x393_camsync_io_t
;
// CAMSYNC mode
// CAMSYNC mode
typedef
struct
{
typedef
union
{
u32
ts_chns_set
:
1
;
// [ 14] (0) Set 'ts_chns'
struct
{
u32
ts_chns
:
4
;
// [13:10] (1) Channels to generate timestmp messages (bit mask)
u32
:
17
;
u32
master_chn_set
:
1
;
// [ 9] (0) Set 'master_chn'
u32
ts_chns_set
:
1
;
// [ 14] (0) Set 'ts_chns'
u32
master_chn
:
2
;
// [ 8: 7] (0) master sensor channel (zero delay in internal trigger mode, delay used for flash output)
u32
ts_chns
:
4
;
// [13:10] (1) Channels to generate timestmp messages (bit mask)
u32
trig_set
:
1
;
// [ 6] (0) Set 'trig'
u32
master_chn_set
:
1
;
// [ 9] (0) Set 'master_chn'
u32
trig
:
1
;
// [ 5] (1) Sensor triggered mode (0 - free running sesnor)
u32
master_chn
:
2
;
// [ 8: 7] (0) master sensor channel (zero delay in internal trigger mode, delay used for flash output)
u32
ext_set
:
1
;
// [ 4] (0) Set 'ext'
u32
trig_set
:
1
;
// [ 6] (0) Set 'trig'
u32
ext
:
1
;
// [ 3] (1) Use external (received) timestamps, if available. O - use local timestamps
u32
trig
:
1
;
// [ 5] (1) Sensor triggered mode (0 - free running sesnor)
u32
en_snd_set
:
1
;
// [ 2] (0) Set 'en_snd'
u32
ext_set
:
1
;
// [ 4] (0) Set 'ext'
u32
en_snd
:
1
;
// [ 1] (1) Enable sending timestamps (valid with 'en_snd_set')
u32
ext
:
1
;
// [ 3] (1) Use external (received) timestamps, if available. O - use local timestamps
u32
en
:
1
;
// [ 0] (1) Enable CAMSYNC module
u32
en_snd_set
:
1
;
// [ 2] (0) Set 'en_snd'
u32
en_snd
:
1
;
// [ 1] (1) Enable sending timestamps (valid with 'en_snd_set')
u32
en
:
1
;
// [ 0] (1) Enable CAMSYNC module
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_camsync_mode_t
;
}
x393_camsync_mode_t
;
// CMDFRAMESEQ mode
// CMDFRAMESEQ mode
typedef
struct
{
typedef
union
{
u32
reset
:
1
;
// [ 14] (0) 1 - reset, 0 - normal operation
struct
{
u32
run_cmd
:
2
;
// [13:12] (0) Run command: 0,1 - nop, 2 - stop, 3 - run
u32
:
17
;
u32
:
10
;
u32
reset
:
1
;
// [ 14] (0) 1 - reset, 0 - normal operation
u32
interrupt_cmd
:
2
;
// [ 1: 0] (0) Interrupt command: 0-nop, 1 - clear is, 2 - disable, 3 - enable
u32
run_cmd
:
2
;
// [13:12] (0) Run command: 0,1 - nop, 2 - stop, 3 - run
u32
:
10
;
u32
interrupt_cmd
:
2
;
// [ 1: 0] (0) Interrupt command: 0-nop, 1 - clear is, 2 - disable, 3 - enable
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_cmdframeseq_mode_t
;
}
x393_cmdframeseq_mode_t
;
// CMDFRAMESEQ mode
// CMDFRAMESEQ mode
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
struct
{
u32
:
2
;
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
u32
im
:
4
;
// [23:20] (0) Interrupt enable: 1 bit per sensor channel
u32
:
2
;
u32
is
:
4
;
// [19:16] (0) Interrupt status: 1 bit per sensor channel
u32
im
:
4
;
// [23:20] (0) Interrupt enable: 1 bit per sensor channel
u32
frame_num3
:
4
;
// [15:12] (0) Frame number for sensor 0
u32
is
:
4
;
// [19:16] (0) Interrupt status: 1 bit per sensor channel
u32
frame_num2
:
4
;
// [11: 8] (0) Frame number for sensor 0
u32
frame_num3
:
4
;
// [15:12] (0) Frame number for sensor 0
u32
frame_num1
:
4
;
// [ 7: 4] (0) Frame number for sensor 0
u32
frame_num2
:
4
;
// [11: 8] (0) Frame number for sensor 0
u32
frame_num0
:
4
;
// [ 3: 0] (0) Frame number for sensor 0
u32
frame_num1
:
4
;
// [ 7: 4] (0) Frame number for sensor 0
u32
frame_num0
:
4
;
// [ 3: 0] (0) Frame number for sensor 0
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_cmdseqmux_status_t
;
}
x393_cmdseqmux_status_t
;
// Event logger status
// Event logger status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
struct
{
u32
:
2
;
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
u32
sample
:
24
;
// [23: 0] (0) Logger sample number
u32
:
2
;
u32
sample
:
24
;
// [23: 0] (0) Logger sample number
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_logger_status_t
;
}
x393_logger_status_t
;
// Event logger register address
// Event logger register address
typedef
struct
{
typedef
union
{
u32
page
:
2
;
// [ 6: 5] (0) Register page: configuration: 0, IMU: 3, GPS: 1, MSG: 2
struct
{
u32
addr
:
5
;
// [ 4: 0] (0) Register address (autoincrements in 32 DWORDs (page) range
u32
:
25
;
u32
page
:
2
;
// [ 6: 5] (0) Register page: configuration: 0, IMU: 3, GPS: 1, MSG: 2
u32
addr
:
5
;
// [ 4: 0] (0) Register address (autoincrements in 32 DWORDs (page) range
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_logger_address_t
;
}
x393_logger_address_t
;
// Event logger register data
// Event logger register data
...
@@ -860,54 +1270,79 @@ typedef union {
...
@@ -860,54 +1270,79 @@ typedef union {
u32
imu_slot
:
2
;
// [ 1: 0] (0) IMU slot
u32
imu_slot
:
2
;
// [ 1: 0] (0) IMU slot
}
struct_0
;
}
struct_0
;
struct
{
struct
{
u32
data32
:
32
;
// [31: 0] (0) Other logger register data (context-dependent)
u32
data
:
32
;
// [31: 0] (0) Other logger register data (context-dependent)
}
struct_1
;
}
struct_1
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_2
;
}
x393_logger_data_t
;
}
x393_logger_data_t
;
// MULT_SAXI DMA addresses/lengths in 32-bit DWORDS
// MULT_SAXI DMA addresses/lengths in 32-bit DWORDS
typedef
struct
{
typedef
union
{
u32
addr32
:
30
;
// [29: 0] (0) SAXI sddress/length in DWORDs
struct
{
u32
:
2
;
u32
addr32
:
30
;
// [29: 0] (0) SAXI sddress/length in DWORDs
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_mult_saxi_al_t
;
}
x393_mult_saxi_al_t
;
// MULTICLK reset/power down controls
// MULTICLK reset/power down controls
typedef
struct
{
typedef
union
{
u32
rst_ffclk1
:
1
;
// [ 10] (0) reset ffclk1 (exteranl in, not yet used) toggle FF
struct
{
u32
rst_ffclk0
:
1
;
// [ 9] (0) reset ffclk0 (external in for sensors) toggle FF
u32
:
21
;
u32
rst_memclk
:
1
;
// [ 8] (0) reset memclk (external in for memory) toggle FF
u32
rst_ffclk1
:
1
;
// [ 10] (0) reset ffclk1 (exteranl in, not yet used) toggle FF
u32
pwrdwn_clk3
:
1
;
// [ 7] (0) reserved
u32
rst_ffclk0
:
1
;
// [ 9] (0) reset ffclk0 (external in for sensors) toggle FF
u32
pwrdwn_clk2
:
1
;
// [ 6] (0) reserved
u32
rst_memclk
:
1
;
// [ 8] (0) reset memclk (external in for memory) toggle FF
u32
pwrdwn_clk1
:
1
;
// [ 5] (0) Power down for pclk (sensors, from ffclk0)
u32
pwrdwn_clk3
:
1
;
// [ 7] (0) reserved
u32
pwrdwnclk0
:
1
;
// [ 4] (0) Power down PLL for xclk(240MHz), hclk(150MHz)
u32
pwrdwn_clk2
:
1
;
// [ 6] (0) reserved
u32
rst_clk3
:
1
;
// [ 3] (0) reserved
u32
pwrdwn_clk1
:
1
;
// [ 5] (0) Power down for pclk (sensors, from ffclk0)
u32
rst_clk2
:
1
;
// [ 2] (0) reserved
u32
pwrdwnclk0
:
1
;
// [ 4] (0) Power down PLL for xclk(240MHz), hclk(150MHz)
u32
rst_clk1
:
1
;
// [ 1] (0) Reset PLL for pclk (sensors, from ffclk0)
u32
rst_clk3
:
1
;
// [ 3] (0) reserved
u32
rst_clk0
:
1
;
// [ 0] (0) Reset PLL for xclk(240MHz), hclk(150MHz)
u32
rst_clk2
:
1
;
// [ 2] (0) reserved
u32
rst_clk1
:
1
;
// [ 1] (0) Reset PLL for pclk (sensors, from ffclk0)
u32
rst_clk0
:
1
;
// [ 0] (0) Reset PLL for xclk(240MHz), hclk(150MHz)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_multiclk_ctl_t
;
}
x393_multiclk_ctl_t
;
// MULTICLK status
// MULTICLK status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
struct
{
u32
:
1
;
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
u32
idelay_rdy
:
1
;
// [ 24] (0) idelay_ctrl_rdy (juct to prevent from optimization)
u32
:
1
;
u32
:
17
;
u32
idelay_rdy
:
1
;
// [ 24] (0) idelay_ctrl_rdy (juct to prevent from optimization)
u32
tgl_ffclk1
:
1
;
// [ 6] (0) ffclk1 (exteranl in, not yet used) toggle FF
u32
:
17
;
u32
tgl_ffclk0
:
1
;
// [ 5] (0) ffclk0 (external in for sensors) toggle FF
u32
tgl_ffclk1
:
1
;
// [ 6] (0) ffclk1 (exteranl in, not yet used) toggle FF
u32
tgl_memclk
:
1
;
// [ 4] (0) memclk (external in for memory) toggle FF
u32
tgl_ffclk0
:
1
;
// [ 5] (0) ffclk0 (external in for sensors) toggle FF
u32
locked3
:
1
;
// [ 3] (0) ==1, reserved
u32
tgl_memclk
:
1
;
// [ 4] (0) memclk (external in for memory) toggle FF
u32
locked2
:
1
;
// [ 2] (0) ==1, reserved
u32
locked3
:
1
;
// [ 3] (0) ==1, reserved
u32
locked1
:
1
;
// [ 1] (0) Locked PLL for pclk (sensors, from ffclk0)
u32
locked2
:
1
;
// [ 2] (0) ==1, reserved
u32
locked0
:
1
;
// [ 0] (0) Locked PLL for xclk(240MHz), hclk(150MHz)
u32
locked1
:
1
;
// [ 1] (0) Locked PLL for pclk (sensors, from ffclk0)
u32
locked0
:
1
;
// [ 0] (0) Locked PLL for xclk(240MHz), hclk(150MHz)
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_multiclk_status_t
;
}
x393_multiclk_status_t
;
// DEBUG status
// DEBUG status
typedef
struct
{
typedef
union
{
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
struct
{
u32
:
1
;
u32
seq_num
:
6
;
// [31:26] (0) Status sequence number
u32
tgl
:
1
;
// [ 24] (0) Toggles for each DWORD received
u32
:
1
;
u32
:
24
;
u32
tgl
:
1
;
// [ 24] (0) Toggles for each DWORD received
u32
:
24
;
}
struct_0
;
struct
{
u32
d32
:
32
;
// [31: 0] (0) cast to u32
}
struct_1
;
}
x393_debug_status_t
;
}
x393_debug_status_t
;
py393/x393_export_c.py
View file @
7b053ece
...
@@ -61,6 +61,7 @@ class X393ExportC(object):
...
@@ -61,6 +61,7 @@ class X393ExportC(object):
'showType'
:
True
,
'showType'
:
True
,
'showRange'
:
True
,
'showRange'
:
True
,
'nameMembers'
:
True
,
#name each struct in a union
'nameMembers'
:
True
,
#name each struct in a union
'data32'
:
'd32'
,
#union branch that is always u32 ("" to disable)
# 'declare':(26,48,0, 80), #function name, arguments, (body), comments
# 'declare':(26,48,0, 80), #function name, arguments, (body), comments
# 'define': (26,48,72,106), #function name, arguments, body, comments
# 'define': (26,48,72,106), #function name, arguments, body, comments
# 'declare':(29,59,0, 91), #function name, arguments, (body), comments
# 'declare':(29,59,0, 91), #function name, arguments, (body), comments
...
@@ -85,35 +86,12 @@ class X393ExportC(object):
...
@@ -85,35 +86,12 @@ class X393ExportC(object):
self
.
func_def
=
[]
self
.
func_def
=
[]
self
.
save_typedefs
(
self
.
gen_dir
,
self
.
typdefs_file
)
self
.
save_typedefs
(
self
.
gen_dir
,
self
.
typdefs_file
)
# print(self.get_typedefs(frmt_spcs = None))
# for k in self.typedefs:
# print (k+": " + self.typedefs[k]['comment'])
self
.
save_header_file
(
self
.
gen_dir
,
self
.
header_file
)
self
.
save_header_file
(
self
.
gen_dir
,
self
.
header_file
)
self
.
save_func_def_file
(
self
.
gen_dir
,
self
.
func_def_file
)
self
.
save_func_def_file
(
self
.
gen_dir
,
self
.
func_def_file
)
self
.
save_defines_file
(
self
.
gen_dir
,
self
.
defs_file
)
self
.
save_defines_file
(
self
.
gen_dir
,
self
.
defs_file
)
self
.
save_harware_map_file
(
self
.
gen_dir
,
self
.
map_file
)
self
.
save_harware_map_file
(
self
.
gen_dir
,
self
.
map_file
)
# ld= self.define_macros()
# ld+=self.define_other_macros()
# print('\n\n//======== using defines ========')
# for d in ld:
# print(self.expand_define_maxi0(d, mode = "defines",frmt_spcs = None))
# print('\n\n//======== function declarations ========')
# for d in ld:
# fd=self.expand_define_maxi0(d, mode = "func_decl",frmt_spcs = None)
# if fd:
# print(fd)
# print('\n\n//======== function definitions ========')
# for d in ld:
# fd=self.expand_define_maxi0(d, mode = "func_def",frmt_spcs = None)
# if fd:
# print(fd)
# print("\n\n// ===== Sorted address map =====\n")
# sam = self.expand_define_parameters(ld)
# print("sam=",sam)
# for d in sam:
# print(self.expand_define_maxi0(d, mode = "defines", frmt_spcs = None))
def
make_generated
(
self
,
path
):
def
make_generated
(
self
,
path
):
try
:
try
:
os
.
makedirs
(
path
)
os
.
makedirs
(
path
)
...
@@ -1283,18 +1261,26 @@ class X393ExportC(object):
...
@@ -1283,18 +1261,26 @@ class X393ExportC(object):
s
+=
"(
%
s)"
%
(
args
)
s
+=
"(
%
s)"
%
(
args
)
s
=
self
.
str_tab_stop
(
s
,
stops
[
2
])
s
=
self
.
str_tab_stop
(
s
,
stops
[
2
])
if
isDefine
:
if
isDefine
:
s
+=
'{'
if
self
.
typedefs
[
data_type
][
'code'
]:
# not just u32
td
=
'd.
%
s'
%
(
frmt_spcs
[
'data32'
])
else
:
td
=
'd'
# s+='{ %s d; %s = readl(0x%08x'%(data_type, td,address)
s
+=
'{
%
s d;
%
s = readl((void*) '
%
(
data_type
,
td
)
if
address_inc
:
if
address_inc
:
s
+=
'(0x
%08
x'
%
(
address
)
if
multivar
:
if
multivar
:
s
+=
'return (
%
s) readl(0x
%08
x)'
%
(
data_type
,
address
)
for
vn
,
vi
in
zip
(
var_name
,
address_inc
):
for
vn
,
vi
in
zip
(
var_name
,
address_inc
):
s
+=
' + 0x
%
x *
%
s'
%
(
vi
,
vn
.
lower
())
s
+=
' + 0x
%
x *
%
s'
%
(
vi
,
vn
.
lower
())
s
+=
")"
else
:
else
:
s
+=
'return (
%
s) readl(0x
%08
x + 0x
%
x *
%
s)'
%
(
data_type
,
address
,
address_inc
,
arg
)
s
+=
' + 0x
%
x *
%
s'
%
(
address_inc
,
arg
)
s
+=
')'
# s+='return (%s) readl(0x%08x + 0x%x * %s)'%(data_type, address, address_inc, arg)
else
:
else
:
s
+=
'return (
%
s) readl(0x
%08
x)'
%
(
data_type
,
address
)
s
+=
'0x
%08
x'
%
(
address
)
s
+=
';}'
# s+='return (%s) readl(0x%08x)'%(data_type, address)
s
+=
'); return d; }'
else
:
else
:
s
+=
';'
s
+=
';'
if
comment
:
if
comment
:
...
@@ -1312,6 +1298,7 @@ class X393ExportC(object):
...
@@ -1312,6 +1298,7 @@ class X393ExportC(object):
stops
=
frmt_spcs
[(
'declare'
,
'define'
)[
isDefine
]]
stops
=
frmt_spcs
[(
'declare'
,
'define'
)[
isDefine
]]
#TODO: add optional argument range check?
#TODO: add optional argument range check?
data_type
=
self
.
fix_data_type
(
data_type
)
data_type
=
self
.
fix_data_type
(
data_type
)
# self.typedefs['u32']= {'comment':'unsigned 32-bit', 'code':'', 'size':32, 'type':''}
sz
=
self
.
typedefs
[
data_type
][
'size'
]
# check it exists
sz
=
self
.
typedefs
[
data_type
][
'size'
]
# check it exists
if
(
sz
>
32
):
if
(
sz
>
32
):
print
(
"***** Only 32-bit data is supported,
%
s used for
%
s is
%
d bit"
%
(
data_type
,
name
,
sz
))
print
(
"***** Only 32-bit data is supported,
%
s used for
%
s is
%
d bit"
%
(
data_type
,
name
,
sz
))
...
@@ -1333,18 +1320,22 @@ class X393ExportC(object):
...
@@ -1333,18 +1320,22 @@ class X393ExportC(object):
s
+=
"(
%
s)"
%
(
args
)
s
+=
"(
%
s)"
%
(
args
)
s
=
self
.
str_tab_stop
(
s
,
stops
[
2
])
s
=
self
.
str_tab_stop
(
s
,
stops
[
2
])
if
isDefine
:
if
isDefine
:
s
+=
'{'
if
self
.
typedefs
[
data_type
][
'code'
]:
# not just u32
td
=
'd.
%
s'
%
(
frmt_spcs
[
'data32'
])
else
:
td
=
'd'
s
+=
'{writel(
%
s, (void *) '
%
(
td
)
if
address_inc
:
if
address_inc
:
s
+=
'(0x
%08
x'
%
(
address
)
if
multivar
:
if
multivar
:
s
+=
'writel(0x
%08
x'
%
(
address
)
for
vn
,
vi
in
zip
(
var_name
,
address_inc
):
for
vn
,
vi
in
zip
(
var_name
,
address_inc
):
s
+=
' + 0x
%
x *
%
s'
%
(
vi
,
vn
.
lower
())
s
+=
' + 0x
%
x *
%
s'
%
(
vi
,
vn
.
lower
())
s
+=
', (u32) d)'
else
:
else
:
s
+=
'writel(0x
%08
x + 0x
%
x *
%
s, (u32) d)'
%
(
address
,
address_inc
,
arg
)
s
+=
' + 0x
%
x *
%
s'
%
(
address_inc
,
arg
)
s
+=
')'
else
:
else
:
s
+=
'
writel(0x
%08
x, (u32) d)
'
%
(
address
)
s
+=
'
0x
%08
x
'
%
(
address
)
s
+=
';}'
s
+=
'
)
;}'
else
:
else
:
s
+=
';'
s
+=
';'
if
comment
:
if
comment
:
...
@@ -1378,18 +1369,19 @@ class X393ExportC(object):
...
@@ -1378,18 +1369,19 @@ class X393ExportC(object):
s
+=
"(
%
s)"
%
(
args
)
s
+=
"(
%
s)"
%
(
args
)
s
=
self
.
str_tab_stop
(
s
,
stops
[
2
])
s
=
self
.
str_tab_stop
(
s
,
stops
[
2
])
if
isDefine
:
if
isDefine
:
s
+=
'{'
# s+='{'
s
+=
'{writel(0, (void *) '
if
address_inc
:
if
address_inc
:
s
+=
'(0x
%08
x'
%
(
address
)
if
multivar
:
if
multivar
:
s
+=
'writel(0x
%08
x'
%
(
address
)
for
vn
,
vi
in
zip
(
var_name
,
address_inc
):
for
vn
,
vi
in
zip
(
var_name
,
address_inc
):
s
+=
' + 0x
%
x *
%
s'
%
(
vi
,
vn
.
lower
())
s
+=
' + 0x
%
x *
%
s'
%
(
vi
,
vn
.
lower
())
s
+=
', 0)'
else
:
else
:
s
+=
'writel(0x
%08
x + 0x
%
x *
%
s, 0)'
%
(
address
,
address_inc
,
arg
)
s
+=
' + 0x
%
x *
%
s'
%
(
address_inc
,
arg
)
s
+=
')'
else
:
else
:
s
+=
'
writel(0x
%08
x, 0)
'
%
(
address
)
s
+=
'
0x
%08
x
'
%
(
address
)
s
+=
';}'
s
+=
'
)
;}'
else
:
else
:
s
+=
';'
s
+=
';'
if
comment
:
if
comment
:
...
@@ -2274,7 +2266,7 @@ class X393ExportC(object):
...
@@ -2274,7 +2266,7 @@ class X393ExportC(object):
return
dw
return
dw
def
_enc_logger_data
(
self
):
def
_enc_logger_data
(
self
):
dw
=
[]
dw
=
[]
dw
.
append
((
"data
32"
,
0
,
32
,
0
,
"Other logger register data (context-dependent)"
))
dw
.
append
((
"data
"
,
0
,
32
,
0
,
"Other logger register data (context-dependent)"
))
return
dw
return
dw
def
_enc_mult_saxi_addr
(
self
):
def
_enc_mult_saxi_addr
(
self
):
...
@@ -2342,8 +2334,15 @@ class X393ExportC(object):
...
@@ -2342,8 +2334,15 @@ class X393ExportC(object):
"""
"""
TODO: add alternative to bit fields
TODO: add alternative to bit fields
"""
"""
isUnion
=
isinstance
(
data
[
0
],
list
)
frmt_spcs
=
self
.
fix_frmt_spcs
(
frmt_spcs
)
frmt_spcs
=
self
.
fix_frmt_spcs
(
frmt_spcs
)
# print("data=",data)
# print("1.data[0]=",data[0])
if
frmt_spcs
[
'data32'
]:
if
not
isinstance
(
data
[
0
],
list
):
data
=
[
data
]
data
.
append
([(
frmt_spcs
[
'data32'
],
0
,
32
,
0
,
"cast to "
+
frmt_spcs
[
'ftype'
])])
isUnion
=
isinstance
(
data
[
0
],
list
)
# print("2.data[0]=",data[0])
s
=
""
s
=
""
# s = "\n"
# s = "\n"
# if comment:
# if comment:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment