Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mmu-val_v1
Overview
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhengyue Zhao
mmu-val_v1
Commits
04c849dc
Commit
04c849dc
authored
Dec 13, 2021
by
Zhengyue Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
72640c36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
RISCV_mm.v
+37
-0
No files found.
RISCV_mm.v
0 → 100644
View file @
04c849dc
module
RISCV_mm
(
reset
,
clk
,
read_address
,
read_valid
write_address
,
write_data
,
write_valid
,
store_data_size
,
read_data
,
read_data_valid
,
write_data_bvalid
)
;
input
reset
,
clk
;
input
[
31
:
0
]
read_address
,
write_address
,
write_data
;
input
read_valid
,
write_valid
;
input
[
1
:
0
]
store_data_size
;
output
[
31
:
0
]
read_data
;
output
read_data_valid
,
write_data_bvalid
;
wire
[
31
:
0
]
Address
;
assign
Address
=
read_valid
?
read_address
:
write_valid
?
write_address
:
32'b0
;
parameter
RAM_SIZE
=
1024
*
1024
;
parameter
RAM_SIZE_BIT
=
20
;
reg
[
31
:
0
]
RAM_data
[
RAM_SIZE
-
1
:
0
]
;
assign
read_data
=
read_valid
?
RAM_data
[
Address
[
31
:
12
]]
:
32'h00000000
;
assign
read_data_valid
=
read_valid
?
1'b1
:
1'b0
;
integer
i
;
always
@
(
posedge
reset
or
posedge
clk
)
if
(
reset
)
for
(
i
=
0
;
i
<
RAM_SIZE
;
i
=
i
+
1
)
RAM_data
[
i
]
<=
32'h00000000
;
else
if
(
write_valid
)
begin
RAM_data
[
Address
[
31
:
12
]]
<=
write_data
[
store_data_size
*
8
-
1
:
0
]
;
write_data_bvalid
=
1'b0
;
end
endmodule
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