Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
VME64x core
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
VME64x core
Commits
37e459e7
Commit
37e459e7
authored
Sep 12, 2017
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simple_tb: add write16
parent
1a75808f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
11 deletions
+43
-11
top_tb.vhd
hdl/vme64x-core/sim/simple_tb/top_tb.vhd
+43
-11
No files found.
hdl/vme64x-core/sim/simple_tb/top_tb.vhd
View file @
37e459e7
...
...
@@ -583,22 +583,38 @@ begin
end
loop
;
end
read8_conf_mb
;
procedure
write8
(
addr
:
std_logic_vector
(
31
downto
0
);
am
:
vme_am_t
;
data
:
byte_t
)
is
variable
l
:
line
;
procedure
write_setup_addr
(
addr
:
std_logic_vector
(
31
downto
0
);
lword_n
:
std_logic
;
am
:
vme_am_t
)
is
begin
if
not
(
VME_DTACK_OE_o
=
'0'
and
VME_BERR_o
=
'0'
)
then
wait
until
VME_DTACK_OE_o
=
'0'
and
VME_BERR_o
=
'0'
;
end
if
;
VME_ADDR_i
<=
addr
(
31
downto
1
);
VME_AM_i
<=
am
;
VME_LWORD_n_i
<=
'1'
;
VME_LWORD_n_i
<=
lword_n
;
VME_IACK_n_i
<=
'1'
;
wait
for
35
ns
;
VME_AS_n_i
<=
'0'
;
VME_WRITE_n_i
<=
'0'
;
end
write_setup_addr
;
procedure
write_wait_dtack
is
begin
wait
until
VME_DTACK_OE_o
=
'1'
and
VME_DTACK_n_o
=
'0'
;
VME_DS_n_i
<=
"11"
;
wait
until
VME_DTACK_OE_o
=
'0'
or
VME_DTACK_n_o
=
'1'
;
VME_AS_n_i
<=
'1'
;
end
write_wait_dtack
;
procedure
write8
(
addr
:
std_logic_vector
(
31
downto
0
);
am
:
vme_am_t
;
data
:
byte_t
)
is
variable
l
:
line
;
begin
write_setup_addr
(
addr
,
'1'
,
am
);
if
addr
(
0
)
=
'0'
then
VME_DS_n_i
<=
"01"
;
...
...
@@ -608,13 +624,25 @@ begin
VME_DATA_i
(
7
downto
0
)
<=
data
;
end
if
;
wait
until
VME_DTACK_OE_o
=
'1'
and
VME_DTACK_n_o
=
'0'
;
VME_DS_n_i
<=
"11"
;
wait
until
VME_DTACK_OE_o
=
'0'
or
VME_DTACK_n_o
=
'1'
;
VME_AS_n_i
<=
'1'
;
write_wait_dtack
;
end
write8
;
procedure
write16
(
addr
:
std_logic_vector
(
31
downto
0
);
am
:
vme_am_t
;
data
:
word_t
)
is
variable
l
:
line
;
begin
assert
addr
(
0
)
=
'0'
report
"unaligned write16"
severity
error
;
write_setup_addr
(
addr
,
'1'
,
am
);
VME_DS_n_i
<=
"00"
;
VME_DATA_i
(
15
downto
0
)
<=
data
;
write_wait_dtack
;
end
write16
;
procedure
write8_conf
(
addr
:
cfg_addr_t
;
data
:
byte_t
)
is
...
...
@@ -841,6 +869,10 @@ begin
read32
(
x"56_00_00_14"
,
c_AM_A32
,
d32
);
assert
d32
=
x"1f00_0500"
report
"bad read at 014 (2)"
severity
error
;
write16
(
x"56_00_00_16"
,
c_AM_A32
,
x"abcd"
);
read32
(
x"56_00_00_14"
,
c_AM_A32
,
d32
);
assert
d32
=
x"1f00_abcd"
report
"bad read at 014 (3)"
severity
error
;
end
case
;
wait
for
10
ns
;
...
...
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