Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
instr16
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Niels Möller
instr16
Commits
83079073
Commit
83079073
authored
4 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Use add_h64 and carry_64 in srt_reciprocal.
parent
901225dc
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
hw/Makefile
+1
-1
1 addition, 1 deletion
hw/Makefile
hw/cpu-all.vl
+2
-1
2 additions, 1 deletion
hw/cpu-all.vl
hw/srt-reciprocal-tb.vl
+1
-0
1 addition, 0 deletions
hw/srt-reciprocal-tb.vl
hw/srt-reciprocal.vl
+7
-10
7 additions, 10 deletions
hw/srt-reciprocal.vl
with
11 additions
and
12 deletions
hw/Makefile
+
1
−
1
View file @
83079073
...
...
@@ -39,7 +39,7 @@ mul-6w64-tb: add-gp.vl add-bk8.vl add-bk8s.vl \
add-h64.vl mul6-stage.vl mul-6w64.vl mul64-tb.vl
# When re-enabling add_h64: add-gp.vl add-h64.vl
srt-reciprocal-tb
:
add-bk8.vl add-bk8s.vl srt-reciprocal.vl
srt-reciprocal-tb
:
add-bk8.vl add-bk8s.vl
carry-64.vl
srt-reciprocal.vl
genmask-tb
:
genmask.vl
ctz-tb
:
ctz.vl
...
...
This diff is collapsed.
Click to expand it.
hw/cpu-all.vl
+
2
−
1
View file @
83079073
...
...
@@ -36,9 +36,10 @@
`include "instr-fetch.vl"
`include "ctz.vl"
`include "popc.vl"
`include "srt-reciprocal.vl"
`include "add-gp.vl"
`include "add-bk8.vl"
`include "add-bk8s.vl"
`include "add-h64.vl"
`include "carry-64.vl"
`include "srt-reciprocal.vl"
`include "cpu.vl"
This diff is collapsed.
Click to expand it.
hw/srt-reciprocal-tb.vl
+
1
−
0
View file @
83079073
...
...
@@ -18,6 +18,7 @@
`include "add-bk8.vl"
`include "add-bk8s.vl"
`include "add-h64.vl"
`include "carry-64.vl"
`include "srt-reciprocal.vl"
module main;
...
...
This diff is collapsed.
Click to expand it.
hw/srt-reciprocal.vl
+
7
−
10
View file @
83079073
...
...
@@ -73,8 +73,8 @@ module srt_final_q (input [2*n-1:0] q, input adjust, output [n-1:0] out);
end
endgenerate
assign out = q_pos + q_neg + !adjust;
//
add_h64 add (q_pos, q_neg, !adjust, {dummy, out});
//
assign out = q_pos + q_neg + !adjust;
add_h64 add (q_pos, q_neg, !adjust, {dummy, out});
endmodule // srt_final_q
// NOTE: Requires d input to be kept stable, in reciprocal_unit it is
...
...
@@ -94,7 +94,7 @@ module srt_reciprocal(input clk, input rst, input enable,
wire [1:0] q;
wire [n:0] s;
wire [n-3:2] c;
wire
[n:1] p
;
wire
carry
;
always @(posedge clk) begin
if (rst) begin
...
...
@@ -123,12 +123,9 @@ module srt_reciprocal(input clk, input rst, input enable,
srt_qsel qsel(s_reg[n:n-3], q);
srt_update #(n) update({s_reg[n-1:0], 1'b1}, c_reg, d, q, s, c);
/* FIXME: Only need sign bit from this addition. Should be arranged
so we get the resulting sign from a Kogge-Stone tree, in
parallel with most of the addition work to construct q, with
only final carry-select logic remaining when the sign is ready.
*/
assign p = s_reg[n:1] + {3'b0, c_reg};
/* Only need sign bit from this addition */
carry_64 carry_adjust({s_reg[n-1:1], 1'b0}, {3'b0, c_reg, 1'b0}, 1'b0, carry);
srt_final_q #(n) final_q (q_reg, p[n], q_out);
/* Construct sign as carry ^ s_reg[n] */
srt_final_q #(n) final_q (q_reg, carry ^ s_reg[n], q_out);
endmodule // srt_reciprocal
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