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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Deike, Benedikt
Projekt
Commits
04e1115f
Commit
04e1115f
authored
4 years ago
by
Deike, Benedikt
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
fd1a038c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Hardware/processor.vhd
+168
-0
168 additions, 0 deletions
Hardware/processor.vhd
with
168 additions
and
0 deletions
Hardware/processor.vhd
0 → 100644
+
168
−
0
View file @
04e1115f
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
use
work
.
pkgProcessor
.
all
;
entity
processor
is
port
(
--------------------------------------------------
-- external processor signals --------------------
--------------------------------------------------
clock
:
in
std_logic
;
nR
:
in
std_logic
;
-- IO signals to / from the uROM
uAddr
:
out
std_logic_vector
(
7
downto
0
);
uData
:
in
std_logic_vector
(
35
downto
0
);
-- IO signals to / from RAM and ROM
nCSROM
:
out
std_logic
;
nCSRAM
:
out
std_logic
;
outRegNOE
:
out
std_logic
;
outRegNWE
:
out
std_logic
;
addrBus
:
inout
std_logic_vector
(
15
downto
0
);
dataBus
:
inout
std_logic_vector
(
15
downto
0
)
);
end
processor
;
architecture
arcProcessor
of
processor
is
signal
omnibus
:
std_logic_vector
(
15
downto
0
);
-- signal that are required by the control unit
signal
carry
:
std_logic
;
-- signals that are required for memory addressing
signal
DY
:
std_logic_vector
(
15
downto
0
);
signal
offset4
:
std_logic_vector
(
3
downto
0
);
signal
outAdd
:
std_logic_vector
(
15
downto
0
);
signal
eBuffAdd
:
std_logic
;
-- signals that are required to increase the program
-- counter
signal
imm12
:
std_logic_vector
(
11
downto
0
);
signal
DX
:
std_logic_vector
(
15
downto
0
);
signal
muxPC
:
std_logic_vector
(
1
downto
0
);
signal
ePC
:
std_logic
;
signal
eBuffPC
:
std_logic
;
-- signals that are required to control the external
-- bus interface
signal
nWE
:
std_logic
;
signal
nOE
:
std_logic
;
signal
eMAR
:
std_logic
;
signal
eMDR
:
std_logic
;
signal
eMRR
:
std_logic
;
signal
eBuffMDR
:
std_logic
;
signal
eBuffMRR
:
std_logic
;
-- signals that are required by the datapath (ALU,
-- register file and C register)
signal
opCoAlU
:
std_logic_vector
(
4
downto
0
);
signal
imm4
:
std_logic_vector
(
3
downto
0
);
signal
AX
:
std_logic_vector
(
3
downto
0
);
signal
AY
:
std_logic_vector
(
3
downto
0
);
signal
eC
:
std_logic
;
signal
eAX15
:
std_logic
;
signal
regNWE
:
std_logic
;
signal
eBuffDX
:
std_logic
;
signal
eBuffALU
:
std_logic
;
begin
instCU
:
CU
port
map
(
clock
=>
clock
,
nR
=>
nR
,
uData
=>
uData
,
uAddr
=>
uAddr
,
omnibus
=>
omnibus
,
carry
=>
carry
,
offset4
=>
offset4
,
eBuffAdd
=>
eBuffAdd
,
imm12
=>
imm12
,
muxPC
=>
muxPC
,
ePC
=>
ePC
,
eBuffPC
=>
eBuffPC
,
nWE
=>
nWE
,
nOE
=>
nOE
,
eMAR
=>
eMAR
,
eMDR
=>
eMDR
,
eMRR
=>
eMRR
,
eBuffMDR
=>
eBuffMDR
,
eBuffMRR
=>
eBuffMRR
,
opCoALU
=>
opCoALU
,
imm4
=>
imm4
,
AX
=>
AX
,
AY
=>
AY
,
eC
=>
eC
,
eAX15
=>
eAX15
,
regNWE
=>
regNWE
,
eBuffDX
=>
eBuffDX
,
eBuffALU
=>
eBuffALU
);
instEBI
:
EBI
port
map
(
clock
=>
clock
,
nR
=>
nR
,
nCSROM
=>
nCSROM
,
nCSRAM
=>
nCSRAM
,
outRegNOE
=>
outRegNOE
,
outRegNWE
=>
outRegNWE
,
addrBus
=>
addrBus
,
dataBus
=>
dataBus
,
omnibus
=>
omnibus
,
nOE
=>
nOE
,
nWE
=>
nWE
,
eMAR
=>
eMAR
,
eMDR
=>
eMDR
,
eMRR
=>
eMRR
,
eBuffMDR
=>
eBuffMDR
,
eBuffMRR
=>
eBuffMRR
);
instPC
:
PC
port
map
(
clock
=>
clock
,
nR
=>
nR
,
omnibus
=>
omnibus
,
imm12
=>
imm12
,
muxPC
=>
muxPC
,
DX
=>
DX
,
ePC
=>
ePC
,
eBuffPC
=>
eBuffPC
);
instDatapath
:
datapath
port
map
(
clock
=>
clock
,
nR
=>
nR
,
omnibus
=>
omnibus
,
AX
=>
AX
,
AY
=>
AY
,
eAX15
=>
eAX15
,
regNWE
=>
regNWE
,
opCoALU
=>
opCoALU
,
carry
=>
carry
,
imm4
=>
imm4
,
DX
=>
DX
,
DY
=>
DY
,
eC
=>
eC
,
eBuffDX
=>
eBuffDX
,
eBuffALU
=>
eBuffALU
);
adder
:
process
(
offset4
,
DY
)
is
begin
outAdd
<=
std_logic_vector
(
unsigned
(
DY
)
+
resize
(
shift_left
(
unsigned
(
offset4
),
1
),
outAdd
'length
));
end
process
adder
;
buffAdd
:
process
(
outAdd
,
eBuffAdd
)
is
begin
if
eBuffAdd
=
'1'
then
omnibus
<=
outAdd
;
else
omniBus
<=
(
others
=>
'Z'
);
end
if
;
end
process
buffAdd
;
end
arcProcessor
;
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