-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idiv lzc opt #621
base: master
Are you sure you want to change the base?
Idiv lzc opt #621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good first iter!
,.num_zero_o(clz_a_result) | ||
); | ||
|
||
assign div_shift = (zero_divisor_i) ? width_p-1 : clz_a_result - clz_c_result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should truncate to num_bits_per_iter granularity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great; just need to fix up for 2b at a time
@@ -22,6 +22,8 @@ module bsg_idiv_iterative_controller #(parameter width_p=32, parameter bits_per_ | |||
,input opA_is_neg_i | |||
,input opC_is_neg_i | |||
|
|||
,input [`BSG_SAFE_CLOG2(width_p)-1:0] div_shift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit; coding convention is div_shift_i
@@ -38,6 +40,8 @@ module bsg_idiv_iterative_controller #(parameter width_p=32, parameter bits_per_ | |||
,output logic latch_signed_div_o | |||
,output logic adder1_cin_o | |||
|
|||
,output logic [`BSG_WIDTH(width_p):0] shift_val |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit; coding convention is shift_val_o
@@ -38,6 +40,8 @@ module bsg_idiv_iterative_controller #(parameter width_p=32, parameter bits_per_ | |||
,output logic latch_signed_div_o | |||
,output logic adder1_cin_o | |||
|
|||
,output logic [`BSG_WIDTH(width_p):0] shift_val |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The max value of this seems to be 'BSG_WIDTH(width_p) as it's assigned to width_p or div_shift (which has max value of width_p). I think this port is 1b too wide (or am I misreading?)
@@ -22,6 +22,8 @@ module bsg_idiv_iterative_controller #(parameter width_p=32, parameter bits_per_ | |||
,input opA_is_neg_i | |||
,input opC_is_neg_i | |||
|
|||
,input [`BSG_SAFE_CLOG2(width_p)-1:0] div_shift | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add link to Google design doc in header comment
Do we have a modified schematic for the changes? I think the support for these changes should be based on an input parameter, so the user can select whether they want to pay the area overhead |
Changes made for 2b case. Cleaning up code now. Also, the testing flow is static. Working on making it easier by making makefile updates. |
This PR contains -
Working code for unsigned division with lzc optimization. Both bits_per_iter=1 and bits_per_iter=2 cases are addressed.
Updated Makefile flow:
New design doc with notes - https://docs.google.com/presentation/d/1jtqCfIULkc9yHW3kGDidr9mmkZZK64JpkwFONPGzuxM/edit#slide=id.g21dc5dfbb2f_0_521