Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pythondata-cpu-microwatt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel LiteX
pythondata-cpu-microwatt
Commits
f9807b6d
Commit
f9807b6d
authored
Jun 30, 2020
by
LiteX
Committed by
Travis CI User
Jun 30, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
ce0205b2
'
parents
088a19be
ce0205b2
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
162 additions
and
102 deletions
+162
-102
pythondata_cpu_microwatt/vhdl/common.vhdl
pythondata_cpu_microwatt/vhdl/common.vhdl
+6
-4
pythondata_cpu_microwatt/vhdl/control.vhdl
pythondata_cpu_microwatt/vhdl/control.vhdl
+6
-2
pythondata_cpu_microwatt/vhdl/cr_hazard.vhdl
pythondata_cpu_microwatt/vhdl/cr_hazard.vhdl
+21
-4
pythondata_cpu_microwatt/vhdl/decode1.vhdl
pythondata_cpu_microwatt/vhdl/decode1.vhdl
+15
-15
pythondata_cpu_microwatt/vhdl/decode2.vhdl
pythondata_cpu_microwatt/vhdl/decode2.vhdl
+12
-2
pythondata_cpu_microwatt/vhdl/execute1.vhdl
pythondata_cpu_microwatt/vhdl/execute1.vhdl
+77
-55
pythondata_cpu_microwatt/vhdl/fetch1.vhdl
pythondata_cpu_microwatt/vhdl/fetch1.vhdl
+2
-2
pythondata_cpu_microwatt/vhdl/icache.vhdl
pythondata_cpu_microwatt/vhdl/icache.vhdl
+10
-9
pythondata_cpu_microwatt/vhdl/logical.vhdl
pythondata_cpu_microwatt/vhdl/logical.vhdl
+13
-9
No files found.
pythondata_cpu_microwatt/vhdl/common.vhdl
View file @
f9807b6d
...
...
@@ -31,6 +31,7 @@ package common is
constant
SPR_DEC
:
spr_num_t
:
=
22
;
constant
SPR_SRR0
:
spr_num_t
:
=
26
;
constant
SPR_SRR1
:
spr_num_t
:
=
27
;
constant
SPR_CFAR
:
spr_num_t
:
=
28
;
constant
SPR_HSRR0
:
spr_num_t
:
=
314
;
constant
SPR_HSRR1
:
spr_num_t
:
=
315
;
constant
SPR_SPRG0
:
spr_num_t
:
=
272
;
...
...
@@ -94,8 +95,8 @@ package common is
tb
:
std_ulogic_vector
(
63
downto
0
);
dec
:
std_ulogic_vector
(
63
downto
0
);
msr
:
std_ulogic_vector
(
63
downto
0
);
cfar
:
std_ulogic_vector
(
63
downto
0
);
irq_state
:
irq_state_t
;
irq_nia
:
std_ulogic_vector
(
63
downto
0
);
srr1
:
std_ulogic_vector
(
63
downto
0
);
end
record
;
...
...
@@ -150,6 +151,7 @@ package common is
bypass_data2
:
std_ulogic
;
bypass_data3
:
std_ulogic
;
cr
:
std_ulogic_vector
(
31
downto
0
);
bypass_cr
:
std_ulogic
;
xerc
:
xer_common_t
;
lr
:
std_ulogic
;
rc
:
std_ulogic
;
...
...
@@ -172,7 +174,7 @@ package common is
end
record
;
constant
Decode2ToExecute1Init
:
Decode2ToExecute1Type
:
=
(
valid
=>
'0'
,
unit
=>
NONE
,
insn_type
=>
OP_ILLEGAL
,
bypass_data1
=>
'0'
,
bypass_data2
=>
'0'
,
bypass_data3
=>
'0'
,
lr
=>
'0'
,
rc
=>
'0'
,
oe
=>
'0'
,
invert_a
=>
'0'
,
bypass_cr
=>
'0'
,
lr
=>
'0'
,
rc
=>
'0'
,
oe
=>
'0'
,
invert_a
=>
'0'
,
invert_out
=>
'0'
,
input_carry
=>
ZERO
,
output_carry
=>
'0'
,
input_cr
=>
'0'
,
output_cr
=>
'0'
,
is_32bit
=>
'0'
,
is_signed
=>
'0'
,
xerc
=>
xerc_init
,
reserve
=>
'0'
,
br_pred
=>
'0'
,
byte_reverse
=>
'0'
,
sign_extend
=>
'0'
,
update
=>
'0'
,
nia
=>
(
others
=>
'0'
),
read_data1
=>
(
others
=>
'0'
),
read_data2
=>
(
others
=>
'0'
),
read_data3
=>
(
others
=>
'0'
),
cr
=>
(
others
=>
'0'
),
insn
=>
(
others
=>
'0'
),
data_len
=>
(
others
=>
'0'
),
others
=>
(
others
=>
'0'
));
...
...
@@ -232,8 +234,8 @@ package common is
priv_mode
:
std_ulogic
;
redirect_nia
:
std_ulogic_vector
(
63
downto
0
);
end
record
;
constant
Execute1ToFetch1
Type
Init
:
Execute1ToFetch1Type
:
=
(
redirect
=>
'0'
,
virt_mode
=>
'0'
,
priv_mode
=>
'0'
,
others
=>
(
others
=>
'0'
));
constant
Execute1ToFetch1Init
:
Execute1ToFetch1Type
:
=
(
redirect
=>
'0'
,
virt_mode
=>
'0'
,
priv_mode
=>
'0'
,
others
=>
(
others
=>
'0'
));
type
Execute1ToLoadstore1Type
is
record
valid
:
std_ulogic
;
...
...
pythondata_cpu_microwatt/vhdl/control.vhdl
View file @
f9807b6d
...
...
@@ -38,6 +38,7 @@ entity control is
cr_read_in
:
in
std_ulogic
;
cr_write_in
:
in
std_ulogic
;
cr_bypassable
:
in
std_ulogic
;
valid_out
:
out
std_ulogic
;
stall_out
:
out
std_ulogic
;
...
...
@@ -45,7 +46,8 @@ entity control is
gpr_bypass_a
:
out
std_ulogic
;
gpr_bypass_b
:
out
std_ulogic
;
gpr_bypass_c
:
out
std_ulogic
gpr_bypass_c
:
out
std_ulogic
;
cr_bypass
:
out
std_ulogic
);
end
entity
control
;
...
...
@@ -161,8 +163,10 @@ begin
cr_read_in
=>
cr_read_in
,
cr_write_in
=>
cr_write_valid
,
bypassable
=>
cr_bypassable
,
stall_out
=>
cr_stall_out
stall_out
=>
cr_stall_out
,
use_bypass
=>
cr_bypass
);
control0
:
process
(
clk
)
...
...
pythondata_cpu_microwatt/vhdl/cr_hazard.vhdl
View file @
f9807b6d
...
...
@@ -16,15 +16,18 @@ entity cr_hazard is
cr_read_in
:
in
std_ulogic
;
cr_write_in
:
in
std_ulogic
;
bypassable
:
in
std_ulogic
;
stall_out
:
out
std_ulogic
stall_out
:
out
std_ulogic
;
use_bypass
:
out
std_ulogic
);
end
entity
cr_hazard
;
architecture
behaviour
of
cr_hazard
is
type
pipeline_entry_type
is
record
valid
:
std_ulogic
;
valid
:
std_ulogic
;
bypass
:
std_ulogic
;
end
record
;
constant
pipeline_entry_init
:
pipeline_entry_type
:
=
(
valid
=>
'0'
);
constant
pipeline_entry_init
:
pipeline_entry_type
:
=
(
valid
=>
'0'
,
bypass
=>
'0'
);
type
pipeline_t
is
array
(
0
to
PIPELINE_DEPTH
)
of
pipeline_entry_type
;
constant
pipeline_t_init
:
pipeline_t
:
=
(
others
=>
pipeline_entry_init
);
...
...
@@ -47,7 +50,20 @@ begin
if
complete_in
=
'1'
then
v
(
1
)
.
valid
:
=
'0'
;
end
if
;
stall_out
<=
cr_read_in
and
(
v
(
0
)
.
valid
or
v
(
1
)
.
valid
);
use_bypass
<=
'0'
;
stall_out
<=
'0'
;
if
cr_read_in
=
'1'
then
loop_0
:
for
i
in
0
to
PIPELINE_DEPTH
loop
if
v
(
i
)
.
valid
=
'1'
then
if
r
(
i
)
.
bypass
=
'1'
then
use_bypass
<=
'1'
;
else
stall_out
<=
'1'
;
end
if
;
end
if
;
end
loop
;
end
if
;
-- XXX assumes PIPELINE_DEPTH = 1
if
busy_in
=
'0'
then
...
...
@@ -56,6 +72,7 @@ begin
end
if
;
if
deferred
=
'0'
and
issuing
=
'1'
then
v
(
0
)
.
valid
:
=
cr_write_in
;
v
(
0
)
.
bypass
:
=
bypassable
;
end
if
;
if
flush_in
=
'1'
then
v
(
0
)
.
valid
:
=
'0'
;
...
...
pythondata_cpu_microwatt/vhdl/decode1.vhdl
View file @
f9807b6d
...
...
@@ -60,7 +60,7 @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ZERO
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
NONE
,
'0'
,
'0'
),
-- oris
20
=>
(
ALU
,
OP_RLC
,
RA
,
CONST_SH32
,
RS
,
RA
,
'0'
,
'0'
,
'0'
,
'0'
,
ZERO
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'1'
,
'0'
,
RC
,
'0'
,
'0'
),
-- rlwimi
...
...
@@ -262,19 +262,19 @@ architecture behaviour of decode1 is
2
#
0010010000
#
=>
(
ALU
,
OP_MTCRF
,
NONE
,
NONE
,
RS
,
NONE
,
'0'
,
'1'
,
'0'
,
'0'
,
ZERO
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
NONE
,
'0'
,
'0'
),
-- mtcrf/mtocrf
2
#
0010110010
#
=>
(
ALU
,
OP_MTMSRD
,
NONE
,
NONE
,
RS
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
ZERO
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
NONE
,
'0'
,
'1'
),
-- mtmsrd # ignore top bits and d
2
#
0111010011
#
=>
(
ALU
,
OP_MTSPR
,
NONE
,
NONE
,
RS
,
SPR
,
'0'
,
'0'
,
'0'
,
'0'
,
ZERO
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
NONE
,
'0'
,
'0'
),
-- mtspr
2
#
0001001001
#
=>
(
ALU
,
OP_MUL_H64
,
RA
,
RB
,
NONE
,
RT
,
'0'
,
'
1
'
,
'0'
,
'0'
,
ZERO
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'1'
,
RC
,
'0'
,
'0'
),
-- mulhd
2
#
0000001001
#
=>
(
ALU
,
OP_MUL_H64
,
RA
,
RB
,
NONE
,
RT
,
'0'
,
'
1
'
,
'0'
,
'0'
,
ZERO
,
'0'
,
NONE
,
'0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'
,
'0'
,
'0'
,
'1'
,
RC
,
'0'
,
'0'
),
-- mulld
2
#
1011101001
#
=>
(
ALU
,
OP_MUL_L64
,
RA
,
RB
,
NONE
,
RT
,
'0'
,
'
0
'
,
'0'
,
'0'
,
ZERO
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'1'
,
RC
,
'0'
,
'0'
),
-- mulldo
2
#
0011101011
#
=>
(
ALU
,
OP_MUL_L64
,
RA
,
RB
,
NONE
,
RT
,
'0'
,
'
0
'
,
'0'
,
'0'
,
ZERO
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'1'
,
'1'
,
RC
,
'0'
,
'0'
),
-- mullw
2
#
1011101011
#
=>
(
ALU
,
OP_MUL_L64
,
RA
,
RB
,
NONE
,
RT
,
'0'
,
'
0
'
,
'0'
,
'0'
,
ZERO
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'1'
,
'1'
,
RC
,
'0'
,
'0'
),
-- mullwo
2
#
0111011100
#
=>
(
ALU
,
OP_AND
,
NONE
,
RB
,
RS
,
RA
,
'0'
,
'0'
,
'0'
,
'1'
,
ZERO
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
RC
,
'0'
,
'0'
),
-- nand
2
#
0001101000
#
=>
(
ALU
,
OP_ADD
,
RA
,
NONE
,
NONE
,
RT
,
'0'
,
'0'
,
'1'
,
'0'
,
ONE
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
RC
,
'0'
,
'0'
),
-- neg
2
#
1001101000
#
=>
(
ALU
,
OP_ADD
,
RA
,
NONE
,
NONE
,
RT
,
'0'
,
'0'
,
'1'
,
'0'
,
ONE
,
'0'
,
NONE
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
RC
,
'0'
,
'0'
),
-- nego
...
...
@@ -473,8 +473,8 @@ begin
end
if
;
else
-- Could be OP_RFID
v
.
ispr1
:
=
fast_spr_num
(
SPR_SRR
0
);
v
.
ispr2
:
=
fast_spr_num
(
SPR_SRR
1
);
v
.
ispr1
:
=
fast_spr_num
(
SPR_SRR
1
);
v
.
ispr2
:
=
fast_spr_num
(
SPR_SRR
0
);
end
if
;
elsif
majorop
=
"011110"
then
...
...
pythondata_cpu_microwatt/vhdl/decode2.vhdl
View file @
f9807b6d
...
...
@@ -213,7 +213,10 @@ architecture behaviour of decode2 is
signal
gpr_c_read
:
gpr_index_t
;
signal
gpr_c_bypass
:
std_ulogic
;
signal
cr_write_valid
:
std_ulogic
;
signal
cr_write_valid
:
std_ulogic
;
signal
cr_bypass
:
std_ulogic
;
signal
cr_bypass_avail
:
std_ulogic
;
begin
control_0
:
entity
work
.
control
generic
map
(
...
...
@@ -248,7 +251,9 @@ begin
gpr_c_read_in
=>
gpr_c_read
,
cr_read_in
=>
d_in
.
decode
.
input_cr
,
cr_write_in
=>
cr_write_valid
,
cr_write_in
=>
cr_write_valid
,
cr_bypass
=>
cr_bypass
,
cr_bypassable
=>
cr_bypass_avail
,
valid_out
=>
control_valid_out
,
stall_out
=>
stall_out
,
...
...
@@ -342,6 +347,7 @@ begin
v
.
e
.
oe
:
=
decode_oe
(
d_in
.
decode
.
rc
,
d_in
.
insn
);
end
if
;
v
.
e
.
cr
:
=
c_in
.
read_cr_data
;
v
.
e
.
bypass_cr
:
=
cr_bypass
;
v
.
e
.
xerc
:
=
c_in
.
read_xerc_data
;
v
.
e
.
invert_a
:
=
d_in
.
decode
.
invert_a
;
v
.
e
.
invert_out
:
=
d_in
.
decode
.
invert_out
;
...
...
@@ -388,6 +394,10 @@ begin
gpr_c_read
<=
gspr_to_gpr
(
decoded_reg_c
.
reg
);
cr_write_valid
<=
d_in
.
decode
.
output_cr
or
decode_rc
(
d_in
.
decode
.
rc
,
d_in
.
insn
);
cr_bypass_avail
<=
'0'
;
if
EX1_BYPASS
then
cr_bypass_avail
<=
d_in
.
decode
.
output_cr
;
end
if
;
v
.
e
.
valid
:
=
control_valid_out
;
if
d_in
.
decode
.
unit
=
NONE
then
...
...
pythondata_cpu_microwatt/vhdl/execute1.vhdl
View file @
f9807b6d
This diff is collapsed.
Click to expand it.
pythondata_cpu_microwatt/vhdl/fetch1.vhdl
View file @
f9807b6d
...
...
@@ -83,11 +83,11 @@ begin
v
.
priv_mode
:
=
'1'
;
v_int
.
stop_state
:
=
RUNNING
;
elsif
e_in
.
redirect
=
'1'
then
v
.
nia
:
=
e_in
.
redirect_nia
;
v
.
nia
:
=
e_in
.
redirect_nia
(
63
downto
2
)
&
"00"
;
v
.
virt_mode
:
=
e_in
.
virt_mode
;
v
.
priv_mode
:
=
e_in
.
priv_mode
;
elsif
d_in
.
redirect
=
'1'
then
v
.
nia
:
=
d_in
.
redirect_nia
;
v
.
nia
:
=
d_in
.
redirect_nia
(
63
downto
2
)
&
"00"
;
elsif
stall_in
=
'0'
then
-- For debug stop/step to work properly we need a little bit of
...
...
pythondata_cpu_microwatt/vhdl/icache.vhdl
View file @
f9807b6d
...
...
@@ -32,6 +32,12 @@ entity icache is
SIM
:
boolean
:
=
false
;
-- Line size in bytes
LINE_SIZE
:
positive
:
=
64
;
-- BRAM organisation: We never access more than wishbone_data_bits at
-- a time so to save resources we make the array only that wide, and
-- use consecutive indices for to make a cache "line"
--
-- ROW_SIZE is the width in bytes of the BRAM (based on WB, so 64-bits)
ROW_SIZE
:
positive
:
=
wishbone_data_bits
/
8
;
-- Number of lines in a set
NUM_LINES
:
positive
:
=
32
;
-- Number of ways
...
...
@@ -65,19 +71,14 @@ entity icache is
end
entity
icache
;
architecture
rtl
of
icache
is
-- BRAM organisation: We never access more than wishbone_data_bits at
-- a time so to save resources we make the array only that wide, and
-- use consecutive indices for to make a cache "line"
--
-- ROW_SIZE is the width in bytes of the BRAM (based on WB, so 64-bits)
constant
ROW_SIZE
:
natural
:
=
wishbone_data_bits
/
8
;
constant
ROW_SIZE_BITS
:
natural
:
=
ROW_SIZE
*
8
;
-- ROW_PER_LINE is the number of row (wishbone transactions) in a line
constant
ROW_PER_LINE
:
natural
:
=
LINE_SIZE
/
ROW_SIZE
;
-- BRAM_ROWS is the number of rows in BRAM needed to represent the full
-- icache
constant
BRAM_ROWS
:
natural
:
=
NUM_LINES
*
ROW_PER_LINE
;
-- INSN_PER_ROW is the number of 32bit instructions per BRAM row
constant
INSN_PER_ROW
:
natural
:
=
wishbone_data_bits
/
32
;
constant
INSN_PER_ROW
:
natural
:
=
ROW_SIZE_BITS
/
32
;
-- Bit fields counts in the address
-- INSN_BITS is the number of bits to select an instruction in a row
...
...
@@ -118,7 +119,7 @@ architecture rtl of icache is
subtype
row_in_line_t
is
unsigned
(
ROW_LINEBITS
-1
downto
0
);
-- The cache data BRAM organized as described above for each way
subtype
cache_row_t
is
std_ulogic_vector
(
wishbone_data_bits
-1
downto
0
);
subtype
cache_row_t
is
std_ulogic_vector
(
ROW_SIZE_BITS
-1
downto
0
);
-- The cache tags LUTRAM has a row per set. Vivado is a pain and will
-- not handle a clean (commented) definition of the cache tags as a 3d
...
...
@@ -363,7 +364,7 @@ begin
way
:
entity
work
.
cache_ram
generic
map
(
ROW_BITS
=>
ROW_BITS
,
WIDTH
=>
wishbone_data_bits
WIDTH
=>
ROW_SIZE_BITS
)
port
map
(
clk
=>
clk
,
...
...
pythondata_cpu_microwatt/vhdl/logical.vhdl
View file @
f9807b6d
...
...
@@ -87,12 +87,19 @@ begin
end
if
;
case
op
is
when
OP_AND
=>
tmp
:
=
rs
and
rb_adj
;
when
OP_OR
=>
tmp
:
=
rs
or
rb_adj
;
when
OP_XOR
=>
tmp
:
=
rs
xor
rb_adj
;
when
OP_AND
|
OP_OR
|
OP_XOR
=>
case
op
is
when
OP_AND
=>
tmp
:
=
rs
and
rb_adj
;
when
OP_OR
=>
tmp
:
=
rs
or
rb_adj
;
when
others
=>
tmp
:
=
rs
xor
rb_adj
;
end
case
;
if
invert_out
=
'1'
then
tmp
:
=
not
tmp
;
end
if
;
when
OP_POPCNT
=>
tmp
:
=
popcnt
;
when
OP_PRTY
=>
...
...
@@ -115,9 +122,6 @@ begin
tmp
(
7
downto
0
)
:
=
rs
(
7
downto
0
);
end
case
;
if
invert_out
=
'1'
then
tmp
:
=
not
tmp
;
end
if
;
result
<=
tmp
;
end
process
;
...
...
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