Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL RS485 - Gateware
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL RS485 - Gateware
Commits
289c8e93
Commit
289c8e93
authored
Mar 09, 2018
by
Evangelia Gousiou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction on glitch filter test; added two more tests of glitch filter with TTL bar
parent
198e95b5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
191 additions
and
60 deletions
+191
-60
testbench.vhd
sim/testbench.vhd
+170
-50
testbench_pkg.vhd
sim/testbench_pkg.vhd
+21
-10
No files found.
sim/testbench.vhd
View file @
289c8e93
This diff is collapsed.
Click to expand it.
sim/testbench_pkg.vhd
View file @
289c8e93
...
...
@@ -47,7 +47,8 @@ package testbench_pkg is
constant
C_NR_MASTERS
:
positive
:
=
1
;
constant
C_NR_SLAVES
:
positive
:
=
1
;
constant
C_RTM
:
std_logic_vector
(
5
downto
0
)
:
=
"010101"
;
constant
C_NO_RTM
:
std_logic_vector
(
5
downto
0
)
:
=
"000000"
;
constant
C_RTM_DB9
:
std_logic_vector
(
5
downto
0
)
:
=
"000101"
;
constant
C_INITIAL_TST_VALUE
:
std_logic_vector
(
31
downto
0
)
:
=
x"FFFFFFF0"
;
constant
C_I2C_MASTER_SLV_ADDR
:
std_logic_vector
(
6
downto
0
)
:
=
"1011110"
;
...
...
@@ -259,6 +260,7 @@ end component conv_ttl_rs485;
procedure
settings_config
(
constant
glitch_filter_en
:
in
std_logic
;
constant
ttl_out_bar_en
:
in
std_logic
;
constant
rtm_value
:
in
std_logic_vector
(
5
downto
0
);
signal
sw_gp_n
:
out
std_logic_vector
(
7
downto
0
);
signal
sw_other
:
out
std_logic_vector
(
31
downto
0
);
signal
pcbrev
:
out
std_logic_vector
(
5
downto
0
);
...
...
@@ -297,23 +299,30 @@ package body testbench_pkg is
--==================================================================================================
procedure
settings_config
(
constant
glitch_filter_en
:
in
std_logic
;
constant
ttl_out_bar_en
:
in
std_logic
;
signal
sw_gp_n
:
out
std_logic_vector
(
7
downto
0
);
signal
sw_other
:
out
std_logic_vector
(
31
downto
0
);
signal
pcbrev
:
out
std_logic_vector
(
5
downto
0
);
signal
rtm
:
out
std_logic_vector
(
5
downto
0
))
is
constant
rtm_value
:
in
std_logic_vector
(
5
downto
0
);
signal
sw_gp_n
:
out
std_logic_vector
(
7
downto
0
);
signal
sw_other
:
out
std_logic_vector
(
31
downto
0
);
signal
pcbrev
:
out
std_logic_vector
(
5
downto
0
);
signal
rtm
:
out
std_logic_vector
(
5
downto
0
))
is
begin
sw_gp_n
(
0
)
<=
not
glitch_filter_en
;
if
glitch_filter_en
=
'1'
then
print_now
(
"Glitch filter enabled"
);
print_now
(
"
-
Glitch filter enabled"
);
else
print_now
(
"Glitch filter disabled"
);
print_now
(
"
-
Glitch filter disabled"
);
end
if
;
sw_gp_n
(
7
)
<=
ttl_out_bar_en
;
if
ttl_out_bar_en
=
'1'
then
print_now
(
"TTL output BAR enabled"
);
print_now
(
"- TTL output BAR enabled"
);
else
print_now
(
"- TTL output BAR disabled"
);
end
if
;
if
rtm_value
=
C_RTM_DB9
then
print_now
(
"- DB9 RTM plugged in"
);
else
print_now
(
"
TTL output BAR disabled
"
);
print_now
(
"
- No particular RTM
"
);
end
if
;
--print_now_s_std("RTMP & RTMM set to x", C_RTM);
...
...
@@ -321,7 +330,9 @@ package body testbench_pkg is
sw_gp_n
(
6
downto
1
)
<=
(
others
=>
'0'
);
-- not used
sw_other
<=
(
others
=>
'0'
);
-- not used
pcbrev
<=
"111100"
;
-- not used
rtm
<=
C_RTM
;
-- not used
rtm
<=
rtm_value
;
end
procedure
;
----------------------------------------------------------------------------------------------------
...
...
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