Skip to content
GitLab
Explore
Sign in
Register
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
fa3a52e4
Commit
fa3a52e4
authored
2 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Add procedures to access MM bus.
parent
b3f01d9c
No related branches found
No related tags found
1 merge request
!293
Rename eth_stream into eth_stream_udp. Create new eth_stream.vhd that contains...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/common/src/vhdl/common_mem_pkg.vhd
+47
-2
47 additions, 2 deletions
libraries/base/common/src/vhdl/common_mem_pkg.vhd
with
47 additions
and
2 deletions
libraries/base/common/src/vhdl/common_mem_pkg.vhd
+
47
−
2
View file @
fa3a52e4
...
...
@@ -109,7 +109,27 @@ PACKAGE common_mem_pkg IS
FUNCTION
RESIZE_MEM_UDATA
(
vec
:
STD_LOGIC_VECTOR
)
RETURN
STD_LOGIC_VECTOR
;
-- unsigned
FUNCTION
RESIZE_MEM_SDATA
(
vec
:
STD_LOGIC_VECTOR
)
RETURN
STD_LOGIC_VECTOR
;
-- sign extended
FUNCTION
RESIZE_MEM_XDATA
(
vec
:
STD_LOGIC_VECTOR
)
RETURN
STD_LOGIC_VECTOR
;
-- set unused MSBits to 'X'
------------------------------------------------------------------------------
-- Procedures to access MM bus
-- . no mm_clk, combinatoral inputs only, to allow use in a state machine
-- . similar proc_mem_mm_bus_*() procs in tb_common_mem_pkg.vhd do have
-- mm_clk inputs
-- . if mm_copi.waitrequest is used, then issue the MM access and externaly
-- check and wait for mm_copi.waitrequest = '0' before removing the MM
-- access.
------------------------------------------------------------------------------
PROCEDURE
proc_mem_bus_wr
(
CONSTANT
wr_addr
:
IN
NATURAL
;
CONSTANT
wr_data
:
IN
INTEGER
;
SIGNAL
mm_copi
:
OUT
t_mem_copi
);
PROCEDURE
proc_mem_bus_wr
(
CONSTANT
wr_addr
:
IN
NATURAL
;
CONSTANT
wr_data
:
IN
STD_LOGIC_VECTOR
;
SIGNAL
mm_copi
:
OUT
t_mem_copi
);
PROCEDURE
proc_mem_bus_rd
(
CONSTANT
wr_addr
:
IN
NATURAL
;
SIGNAL
mm_copi
:
OUT
t_mem_copi
);
------------------------------------------------------------------------------
-- Burst memory access (for DDR access interface)
------------------------------------------------------------------------------
...
...
@@ -279,7 +299,32 @@ PACKAGE BODY common_mem_pkg IS
v_vec
(
vec
'LENGTH
-1
DOWNTO
0
)
:
=
vec
;
RETURN
v_vec
;
END
RESIZE_MEM_XDATA
;
-- Procedures to access MM bus
PROCEDURE
proc_mem_bus_wr
(
CONSTANT
wr_addr
:
IN
NATURAL
;
CONSTANT
wr_data
:
IN
INTEGER
;
SIGNAL
mm_copi
:
OUT
t_mem_copi
)
IS
BEGIN
mm_copi
.
address
<=
TO_MEM_ADDRESS
(
wr_addr
);
mm_copi
.
wrdata
<=
TO_MEM_DATA
(
wr_data
);
mm_copi
.
wr
<=
'1'
;
END
proc_mem_bus_wr
;
PROCEDURE
proc_mem_bus_wr
(
CONSTANT
wr_addr
:
IN
NATURAL
;
CONSTANT
wr_data
:
IN
STD_LOGIC_VECTOR
;
SIGNAL
mm_copi
:
OUT
t_mem_copi
)
IS
BEGIN
mm_copi
.
address
<=
TO_MEM_ADDRESS
(
wr_addr
);
mm_copi
.
wrdata
<=
RESIZE_MEM_DATA
(
wr_data
);
mm_copi
.
wr
<=
'1'
;
END
proc_mem_bus_wr
;
PROCEDURE
proc_mem_bus_rd
(
CONSTANT
wr_addr
:
IN
NATURAL
;
SIGNAL
mm_copi
:
OUT
t_mem_copi
)
IS
BEGIN
mm_copi
.
address
<=
TO_MEM_ADDRESS
(
wr_addr
);
mm_copi
.
rd
<=
'1'
;
END
proc_mem_bus_rd
;
-- Resize functions to fit an integer or an SLV in the corresponding t_mem_miso or t_mem_mosi field width
FUNCTION
TO_MEM_CTLR_ADDRESS
(
n
:
INTEGER
)
RETURN
STD_LOGIC_VECTOR
IS
...
...
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