Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Projekt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Deike, Benedikt
Projekt
Commits
8084ba3a
Commit
8084ba3a
authored
4 years ago
by
Deike, Benedikt
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
04e1115f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Hardware/testbench.vhd
+127
-0
127 additions, 0 deletions
Hardware/testbench.vhd
with
127 additions
and
0 deletions
Hardware/testbench.vhd
0 → 100644
+
127
−
0
View file @
8084ba3a
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
use
work
.
pkgProcessor
.
all
;
entity
testbench
is
generic
(
clkPeriod
:
time
:
=
5
ns
;
clkCycles
:
positive
:
=
10000
);
end
testbench
;
architecture
arcTestbench
of
testbench
is
signal
clock
:
std_logic
;
signal
nR
:
std_logic
;
-- IO signals to / from the uROM
signal
uAddr
:
std_logic_vector
(
7
downto
0
);
signal
uData
:
std_logic_vector
(
35
downto
0
);
-- IO signals to / from RAM and ROM
signal
nCSROM
:
std_logic
;
signal
nCSRAM
:
std_logic
;
signal
outRegNOE
:
std_logic
;
signal
outRegNWE
:
std_logic
;
signal
addrBus
:
std_logic_vector
(
15
downto
0
);
signal
dataBus
:
std_logic_vector
(
15
downto
0
);
-- only bits <10:0> of the address bus are
-- physically and only bits <10:1> of the
-- address bus are logically connected to
-- the ROM and the RAM
-- signal addrBusCircumcised : std_logic_vector(10 downto 0);
-- SRAM control signals
signal
nCSuROM
:
std_logic
;
signal
opCouROM
:
tyOpCoSRAM
;
signal
opCoROM
:
tyOpCoSRAM
;
signal
opCoRAM
:
tyOpCoSRAM
;
begin
stimulus
:
process
is
variable
runtime
:
time
:
=
clkPeriod
*
clkCycles
;
begin
nR
<=
'0'
,
'1'
after
5
ns
;
nCSuROM
<=
'1'
,
'0'
after
5
ns
;
opCouROM
<=
load
,
none
after
5
ns
;
opCoROM
<=
load
,
none
after
5
ns
;
opCoRAM
<=
load
,
none
after
5
ns
;
wait
for
5
ns
;
for
n
in
1
to
clkCycles
loop
clock
<=
'0'
,
'1'
after
clkPeriod
/
2
;
wait
for
clkPeriod
;
end
loop
;
wait
for
runtime
;
opCoRAM
<=
store
,
none
after
5
ns
;
wait
;
end
process
stimulus
;
-- addrBusCircumcised <= addrBus(10 downto 1) & '0';
uROM
:
SRAM
generic
map
(
cellWd
=>
36
,
wordWd
=>
1
,
addrWd
=>
8
,
fileID
=>
"memory/uROM.dat"
)
port
map
(
opCoSRAM
=>
opCouROM
,
nCS
=>
nCSuROM
,
nWE
=>
'1'
,
nOE
=>
'0'
,
addr
=>
uAddr
,
data
=>
uData
);
ROM
:
SRAM
generic
map
(
cellWd
=>
8
,
wordWd
=>
2
,
addrWd
=>
11
,
fileID
=>
"memory/Fibonacci.dat"
)
port
map
(
opCoSRAM
=>
opCoROM
,
nCS
=>
nCSROM
,
nWE
=>
'1'
,
nOE
=>
outRegNOE
,
-- addr => addrBusCircumcised,
addr
=>
addrBus
(
10
downto
0
),
data
=>
dataBus
);
RAM
:
SRAM
generic
map
(
cellWd
=>
8
,
wordWd
=>
2
,
addrWd
=>
11
,
fileID
=>
"memory/RAM.dat"
)
port
map
(
opCoSRAM
=>
opCoRAM
,
nCS
=>
nCSRAM
,
nWE
=>
outRegNWE
,
nOE
=>
outRegNOE
,
-- addr => addrBusCircumcised,
addr
=>
addrBus
(
10
downto
0
),
data
=>
dataBus
);
instProcessor
:
Processor
port
map
(
clock
=>
clock
,
nR
=>
nR
,
uAddr
=>
uAddr
,
uData
=>
uData
,
nCSROM
=>
nCSROM
,
nCSRAM
=>
nCSRAM
,
outRegNOE
=>
outRegNOE
,
outRegNWE
=>
outRegNWE
,
addrBus
=>
addrBus
,
dataBus
=>
dataBus
);
end
arcTestbench
;
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