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
3afb5319
Commit
3afb5319
authored
Jan 31, 2018
by
Evangelia Gousiou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip; changed i2c prescaler to speed-up simulation
parent
954c8112
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
i2c_master_and_driver.vhd
sim/i2c_master_and_driver.vhd
+1
-1
testbench.vhd
sim/testbench.vhd
+6
-4
testbench_pkg.vhd
sim/testbench_pkg.vhd
+1
-1
No files found.
sim/i2c_master_and_driver.vhd
View file @
3afb5319
...
...
@@ -109,7 +109,7 @@ begin
nReset
=>
rst_n_i
,
ena
=>
'1'
,
clk_cnt
=>
x"0027"
,
clk_cnt
=>
x"00
05"
,
-------------x"00
27",
-- input signals
start
=>
mst_sta
,
...
...
sim/testbench.vhd
View file @
3afb5319
...
...
@@ -123,7 +123,7 @@ architecture behav of testbench is
i2c_m_in
.
i2c_master_slv_addr
<=
"1011110"
;
i2c_m_in
.
i2c_master_reg_addr
<=
(
others
=>
'0'
);
i2c_m_in
.
i2c_master_send_val
<=
(
others
=>
'1'
);
wait
for
50
us
;
wait
for
1
us
;
i2c_m_in
.
i2c_master_slv_addr
<=
slv_addr
;
i2c_m_in
.
i2c_master_reg_addr
<=
reg_addr
;
i2c_m_in
.
i2c_master_start
<=
'1'
;
...
...
@@ -344,10 +344,12 @@ begin
report
"started stimulus"
;
wait
for
1
us
;
generate_pulses
(
ttl_n_in
,
25
6
);
generate_pulses
(
ttl_n_in
,
25
0
);
read_i2c
(
i2c_m_in
,
i2c_m_out
,
"1011110"
,
x"0000_0000"
,
i2c_master_rcvd_val
);
read_i2c
(
i2c_m_in
,
i2c_m_out
,
"1011110"
,
x"0000_000C"
,
i2c_master_rcvd_val
);
read_i2c
(
i2c_m_in
,
i2c_m_out
,
"1011110"
,
x"0000_0010"
,
i2c_master_rcvd_val
);
read_i2c
(
i2c_m_in
,
i2c_m_out
,
"1011110"
,
x"0000_0014"
,
i2c_master_rcvd_val
);
read_i2c
(
i2c_m_in
,
i2c_m_out
,
"1011110"
,
x"0000_0018"
,
i2c_master_rcvd_val
);
--11 difference
read_i2c
(
i2c_m_in
,
i2c_m_out
,
"1011110"
,
x"0000_0000"
,
i2c_master_rcvd_val
);
--11 difference
end
process
p_stim_i2c
;
...
...
sim/testbench_pkg.vhd
View file @
3afb5319
...
...
@@ -205,7 +205,7 @@ package body testbench_pkg is
signal
pcbrev
:
out
std_logic_vector
(
5
downto
0
);
signal
rtmm_in
:
out
std_logic_vector
(
2
downto
0
))
is
begin
wait
for
2
us
;
-- does not work without this wait, no idea way ???
--
wait for 2 us; -- does not work without this wait, no idea way ???
sw_gp_n_in
(
0
)
<=
'1'
;
-- disable glitch filter ?
sw_gp_n_in
(
1
)
<=
'1'
;
sw_gp_n_in
(
7
downto
2
)
<=
(
others
=>
'0'
);
...
...
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