Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
2dd68bd2
Commit
2dd68bd2
authored
5 years ago
by
Pieter Donker
Browse files
Options
Downloads
Patches
Plain Diff
STAT-224
: made constants for register offset's, after review remarks.
parent
20d0d94d
No related branches found
No related tags found
1 merge request
!1
STAT-224: Revision id string
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
boards/uniboard2c/libraries/unb2c_board/src/vhdl/unb2c_board_system_info_reg.vhd
+33
-24
33 additions, 24 deletions
...ries/unb2c_board/src/vhdl/unb2c_board_system_info_reg.vhd
with
33 additions
and
24 deletions
boards/uniboard2c/libraries/unb2c_board/src/vhdl/unb2c_board_system_info_reg.vhd
+
33
−
24
View file @
2dd68bd2
...
...
@@ -80,8 +80,15 @@ ARCHITECTURE rtl OF unb2c_board_system_info_reg IS
CONSTANT
c_nof_revision_id_regs
:
NATURAL
:
=
3
;
-- revision id, commit hash or id (hash: first 9 chars of the 40chars commit hash)
CONSTANT
c_nof_design_note_regs
:
NATURAL
:
=
13
;
-- note
CONSTANT
c_nof_regs
:
NATURAL
:
=
c_nof_fixed_regs
+
c_nof_design_name_regs
+
c_nof_stamp_regs
+
c_nof_revision_id_regs
+
c_nof_design_note_regs
;
CONSTANT
c_info_reg
:
NATURAL
:
=
0
;
CONSTANT
c_use_phy_reg
:
NATURAL
:
=
1
;
CONSTANT
c_design_name_offset
:
NATURAL
:
=
c_nof_fixed_regs
;
CONSTANT
c_stamp_date_offset
:
NATURAL
:
=
c_nof_fixed_regs
+
c_nof_design_name_regs
;
CONSTANT
c_stamp_time_offset
:
NATURAL
:
=
c_nof_fixed_regs
+
c_nof_design_name_regs
+
1
;
CONSTANT
c_revision_id_offset
:
NATURAL
:
=
c_nof_fixed_regs
+
c_nof_design_name_regs
+
c_nof_stamp_regs
;
CONSTANT
c_design_note_offset
:
NATURAL
:
=
c_nof_fixed_regs
+
c_nof_design_name_regs
+
c_nof_stamp_regs
+
c_nof_revision_id_regs
;
CONSTANT
c_nof_regs
:
NATURAL
:
=
c_nof_fixed_regs
+
c_nof_design_name_regs
+
c_nof_stamp_regs
+
c_nof_revision_id_regs
+
c_nof_design_note_regs
;
CONSTANT
c_mm_reg
:
t_c_mem
:
=
(
latency
=>
1
,
adr_w
=>
ceil_log2
(
c_nof_regs
),
dat_w
=>
c_word_w
,
-- Use MM bus data width = c_word_w = 32 for all MM registers
...
...
@@ -113,27 +120,29 @@ BEGIN
sla_out
.
rdval
<=
'1'
;
-- c_mm_reg.latency = 1
vA
:
=
TO_UINT
(
sla_in
.
address
(
c_mm_reg
.
adr_w
-1
DOWNTO
0
));
IF
vA
=
0
THEN
IF
vA
=
c_info_reg
THEN
sla_out
.
rddata
(
c_word_w
-1
DOWNTO
0
)
<=
info
;
-- Use bit 11 to indicate that we're using the MM bus (not the info SLV).
-- Using the MM bus enables user to also read use_phy, design_name etc.
sla_out
.
rddata
(
11
)
<=
'1'
;
ELSIF
vA
=
1
THEN
ELSIF
vA
=
c_use_phy_reg
THEN
sla_out
.
rddata
(
c_use_phy_w
-1
DOWNTO
0
)
<=
c_use_phy
;
ELSIF
vA
<
c_nof_fixed_regs
+
c_nof_design_name_regs
THEN
sla_out
.
rddata
(
c_word_w
-1
DOWNTO
0
)
<=
c_design_name
(
vA
-
c_nof_fixed_regs
);
ELSIF
vA
=
c_nof_fixed_regs
+
c_nof_design_name_regs
THEN
ELSIF
vA
<
c_design_name_offset
+
c_nof_design_name_regs
THEN
sla_out
.
rddata
(
c_word_w
-1
DOWNTO
0
)
<=
c_design_name
(
vA
-
c_design_name_offset
);
ELSIF
vA
=
c_stamp_date_offset
THEN
sla_out
.
rddata
(
c_word_w
-1
DOWNTO
0
)
<=
TO_UVEC
(
g_stamp_date
,
c_word_w
);
ELSIF
vA
=
c_
nof_fixed_regs
+
c_nof_design_name_regs
+
1
THEN
ELSIF
vA
=
c_
stamp_time_offset
THEN
sla_out
.
rddata
(
c_word_w
-1
DOWNTO
0
)
<=
TO_UVEC
(
g_stamp_time
,
c_word_w
);
ELSIF
vA
<
c_
nof_fixed_regs
+
c_nof_de
si
g
n_
name_regs
+
c_nof_stamp_regs
+
c_nof_revision_id_regs
THEN
sla_out
.
rddata
(
c_word_w
-1
DOWNTO
0
)
<=
c_revision_id
(
vA
-
c_nof_fixed_regs
-
c_nof_de
si
g
n_
name_regs
-
c_nof_stamp_regs
);
ELSIF
vA
<
c_
revi
si
o
n_
id_offset
+
c_nof_revision_id_regs
THEN
sla_out
.
rddata
(
c_word_w
-1
DOWNTO
0
)
<=
c_revision_id
(
vA
-
c_revi
si
o
n_
id_offset
);
ELSIF
vA
<
c_
nof_fixed_regs
+
c_nof_design_name_regs
+
c_nof_stamp_regs
+
c_nof_revision_id_regs
+
c_nof_design_note_regs
THEN
sla_out
.
rddata
(
c_word_w
-1
DOWNTO
0
)
<=
c_design_note
(
vA
-
c_nof_fixed_regs
-
c_nof_design_name_regs
-
c_nof_stamp_regs
-
c_nof_revision_id_regs
);
ELSIF
vA
<
c_
design_note_offset
+
c_nof_design_note_regs
THEN
sla_out
.
rddata
(
c_word_w
-1
DOWNTO
0
)
<=
c_design_note
(
vA
-
c_design_note_offset
);
END
IF
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment