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
4727bb3e
Commit
4727bb3e
authored
Dec 13, 2021
by
Zhengyue Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
5ceb7c32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
RISCV_pt.v
+45
-0
No files found.
RISCV_pt.v
0 → 100644
View file @
4727bb3e
module
RISCV_pt
(
PTE_address
,
PTE_valid
,
PTE_ply
,
PTE_out
,
PTE_out_valid
,
)
;
input
[
31
:
0
]
PTE_address
;
input
PTE_valid
;
input
[
1
:
0
]
PTE_ply
;
output
[
31
:
0
]
PTE_out
;
output
PTE_valid
;
parameter
PTE_1_num
=
1024
;
parameter
PTE_2_num
=
1024
*
1024
;
integer
i
;
wire
[
31
:
0
]
PTE_1
[
PTE_1_num
-
1
:
0
]
;
wire
[
31
:
0
]
PTE_2
[
PTE_2_num
-
1
:
0
]
;
for
(
i
=
0
;
i
<
PTE_1
;
i
=
i
+
1
)
assign
PTE_1
[
i
]
=
i
[
20
:
0
]
+
12
{{
$
random
}%
2
};
for
(
i
=
0
;
i
<
PTE_2_num
;
i
=
i
+
1
)
assign
PTE_2
[
i
]
=
i
[
20
:
0
]
+
12
{{
$
random
}%
2
};
if
(
PTE_valid
&&
PTE_ply
==
2'b01
)
begin
assign
PTE_out
=
PTE_1
[
PTE_address
[
31
:
22
]]
;
assign
PTE_out_valid
=
1'b1
;
end
else
if
(
PTE_valid
&&
PTE_ply
==
2'b10
)
begin
assign
PTE_out
=
PTE_2
[
PTE_address
[
31
:
12
]]
;
assign
PTE_out_valid
=
1'b1
;
end
else
begin
assign
PTE_out
=
32'h00000000
;
assign
PTE_out_valid
=
1'b0
;
end
endmodule
\ No newline at end of file
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