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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
21e9bb8b
Commit
21e9bb8b
authored
May 29, 2015
by
Daniel van der Schuur
Browse files
Options
Downloads
Patches
Plain Diff
-Finished first generation of wrapper code.
parent
86d0e6ba
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/apertif/designs/apertif_unb1_fn_bf_emu/src/myhdl/gen_mms_diag_block_gen.py
+38
-14
38 additions, 14 deletions
...pertif_unb1_fn_bf_emu/src/myhdl/gen_mms_diag_block_gen.py
with
38 additions
and
14 deletions
applications/apertif/designs/apertif_unb1_fn_bf_emu/src/myhdl/gen_mms_diag_block_gen.py
+
38
−
14
View file @
21e9bb8b
...
@@ -39,10 +39,23 @@ Remarks:
...
@@ -39,10 +39,23 @@ Remarks:
falls outside of the myHDL scope.
falls outside of the myHDL scope.
. We use separate DP signals for now, but we may also combine them into a
. We use separate DP signals for now, but we may also combine them into a
Python record as this is fully supported my myHDL.
Python record as this is fully supported my myHDL.
Usage:
. python gen_mms_diag_block_gen.py
. VHDL files are generated in the same dir.
"""
"""
from
myhdl
import
*
from
myhdl
import
*
###############################################################################
# Constants/generics
# . NOTE: use extra quotes around strings!
###############################################################################
G_NOF_STREAMS
=
4
G_BUF_DAT_W
=
16
G_BUF_ADDR_W
=
256
G_FILE_NAME_PREFIX
=
'"
hex/bg_data
"'
# Note: extra quotes
G_DIAG_BLOCK_GEN_RST
=
'"
FIXME
"'
# Note: extra quotes
###############################################################################
###############################################################################
# MyHDL function definition
# MyHDL function definition
# . VHDL entity I/O ports
# . VHDL entity I/O ports
...
@@ -52,9 +65,9 @@ from myhdl import *
...
@@ -52,9 +65,9 @@ from myhdl import *
# . Not described here (pass). We set the .vhdl_code attribute later on to
# . Not described here (pass). We set the .vhdl_code attribute later on to
# insert literal VHDL.
# insert literal VHDL.
###############################################################################
###############################################################################
def
myhdl_mms_diag_block_gen
_wrap
(
mm_rst
,
mm_clk
,
dp_rst
,
dp_clk
,
out_sosi_arr
):
def
myhdl_mms_diag_block_gen
(
g_nof_streams
,
g_buf_dat_w
,
g_buf_addr_w
,
g_file_name_prefix
,
g_diag_block_gen_rst
,
mm_rst
,
mm_clk
,
dp_rst
,
dp_clk
,
out_sosi_arr
):
@always
(
dp_clk
)
@always
(
mm_rst
,
mm_clk
,
dp_rst
,
dp_clk
)
def
wrap
():
def
wrap
():
# Nothing to do here.
# Nothing to do here.
pass
pass
...
@@ -67,30 +80,41 @@ def myhdl_mms_diag_block_gen_wrap(mm_rst,mm_clk,dp_rst,dp_clk,out_sosi_arr):
...
@@ -67,30 +80,41 @@ def myhdl_mms_diag_block_gen_wrap(mm_rst,mm_clk,dp_rst,dp_clk,out_sosi_arr):
###############################################################################
###############################################################################
# Architecture VHDL code: Instantiate mms_diag_block_gen
# Architecture VHDL code: Instantiate mms_diag_block_gen
# . Note the $ prefix for all myHDL function (myhdl_mms_diag_block_gen)
# arguments.
###############################################################################
###############################################################################
myhdl_mms_diag_block_gen
_wrap
.
vhdl_code
=
\
myhdl_mms_diag_block_gen
.
vhdl_code
=
\
"""
"""
u_mms_diag_block_gen : ENTITY diag_lib.mms_diag_block_gen
u_mms_diag_block_gen : ENTITY diag_lib.mms_diag_block_gen
GENERIC MAP (
GENERIC MAP (
g_nof_streams =>
4
,
g_nof_streams =>
$g_nof_streams
,
g_buf_dat_w =>
16
,
g_buf_dat_w =>
$g_buf_dat_w
,
g_buf_addr_w =>
256
,
g_buf_addr_w =>
$g_buf_addr_w
,
g_file_name_prefix =>
"
hex/bg_data
"
,
g_file_name_prefix =>
$g_file_name_prefix
,
g_diag_block_gen_rst =>
c_bg_ctrl
g_diag_block_gen_rst =>
$g_diag_block_gen_rst
)
)
PORT MAP (
PORT MAP (
mm_rst => mm_rst,
mm_rst =>
$
mm_rst,
mm_clk => mm_clk,
mm_clk =>
$
mm_clk,
dp_rst => dp_rst,
dp_rst =>
$
dp_rst,
dp_clk => dp_clk,
dp_clk =>
$
dp_clk,
out_sosi_arr => out_sosi_arr
out_sosi_arr =>
$
out_sosi_arr
);
);
"""
"""
###############################################################################
###############################################################################
# Convert to VHDL
# Convert to VHDL
###############################################################################
###############################################################################
toVHDL
(
myhdl_mms_diag_block_gen_wrap
,
mm_rst
,
mm_clk
,
dp_rst
,
dp_clk
,
out_sosi_arr
)
mm_clk
=
Signal
(
bool
(
0
))
mm_rst
=
Signal
(
bool
(
0
))
dp_clk
=
Signal
(
bool
(
0
))
dp_rst
=
Signal
(
bool
(
0
))
out_sosi_arr
=
Signal
(
intbv
(
0
)[
8
:])
#FIXME
toVHDL
(
myhdl_mms_diag_block_gen
,
G_NOF_STREAMS
,
G_BUF_DAT_W
,
G_BUF_ADDR_W
,
G_FILE_NAME_PREFIX
,
G_DIAG_BLOCK_GEN_RST
,
mm_rst
,
mm_clk
,
dp_rst
,
dp_clk
,
out_sosi_arr
)
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