Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Risc V Single Cycle Stub
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
秦槿
Risc V Single Cycle Stub
Commits
a16f6380
Commit
a16f6380
authored
2 years ago
by
秦槿
Browse files
Options
Downloads
Patches
Plain Diff
alli
parent
e5cb93a5
Branches
Branches containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
xgriscv_alu.v
+2
-0
2 additions, 0 deletions
xgriscv_alu.v
xgriscv_controller.v
+5
-1
5 additions, 1 deletion
xgriscv_controller.v
xgriscv_datapath.v
+4
-3
4 additions, 3 deletions
xgriscv_datapath.v
with
11 additions
and
4 deletions
xgriscv_alu.v
+
2
−
0
View file @
a16f6380
...
@@ -34,6 +34,8 @@ module alu(
...
@@ -34,6 +34,8 @@ module alu(
`ALU_CTRL_XOR
:
aluout
<=
a
^
b
;
`ALU_CTRL_XOR
:
aluout
<=
a
^
b
;
`ALU_CTRL_AND
:
aluout
<=
a
&
b
;
`ALU_CTRL_AND
:
aluout
<=
a
&
b
;
`ALU_CTRL_SLL
:
aluout
<=
a
<<
shamt
;
//`ALU_CTRL_ZERO
//`ALU_CTRL_ZERO
default:
aluout
<=
`XLEN
'b0
;
default:
aluout
<=
`XLEN
'b0
;
endcase
endcase
...
...
This diff is collapsed.
Click to expand it.
xgriscv_controller.v
+
5
−
1
View file @
a16f6380
...
@@ -111,7 +111,11 @@ module controller(
...
@@ -111,7 +111,11 @@ module controller(
`FUNCT3_ADDI
:
aluctrl
<=
`ALU_CTRL_ADD
;
`FUNCT3_ADDI
:
aluctrl
<=
`ALU_CTRL_ADD
;
`FUNCT3_XORI
:
aluctrl
<=
`ALU_CTRL_XOR
;
`FUNCT3_XORI
:
aluctrl
<=
`ALU_CTRL_XOR
;
`FUNCT3_ANDI
:
aluctrl
<=
`ALU_CTRL_AND
;
`FUNCT3_ANDI
:
aluctrl
<=
`ALU_CTRL_AND
;
default:
aluctrl
<=
`ALU_CTRL_ZERO
;
`FUNCT3_SL
:
case
(
funct7
)
`FUNCT7_SLLI
:
aluctrl
<=
`ALU_CTRL_SLL
;
default:
aluctrl
<=
`ALU_CTRL_ZERO
;
endcase
default:
aluctrl
<=
`ALU_CTRL_ZERO
;
endcase
endcase
default:
aluctrl
<=
`ALU_CTRL_ZERO
;
default:
aluctrl
<=
`ALU_CTRL_ZERO
;
endcase
endcase
...
...
This diff is collapsed.
Click to expand it.
xgriscv_datapath.v
+
4
−
3
View file @
a16f6380
...
@@ -59,9 +59,10 @@ module datapath(
...
@@ -59,9 +59,10 @@ module datapath(
//处理mux
//处理mux
mux2
#(
32
)
mx0
(
rdata2
,
immout
,
alusrcb
,
b
);
mux2
#(
32
)
mx0
(
rdata2
,
immout
,
alusrcb
,
b
);
//alu input b
mux2
#(
32
)
mx1
(
aluout
,
readdata
,
memtoreg
,
wdata
);
mux2
#(
32
)
mx1
(
aluout
,
readdata
,
memtoreg
,
wdata
);
// wdata input
mux3
#(
32
)
mx2
(
rdata1
,
0
,
pc
,
alusrca
,
a
);
mux3
#(
32
)
mx2
(
rdata1
,
0
,
pc
,
alusrca
,
a
);
//alu input a
mux2
#(
5
)
mx2
(
rdata2
,
rs2
,
itype
,
shamt
);
//alu input shamt
imm
im
(
iimm
,
simm
,
bimm
,
uimm
,
jimm
,
immctrl
,
immout
);
imm
im
(
iimm
,
simm
,
bimm
,
uimm
,
jimm
,
immctrl
,
immout
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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