mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
changed priority circuits for synthesis and light cleanup
This commit is contained in:
parent
b2677d2090
commit
437f2d5814
@ -82,7 +82,7 @@ module pmpadrdec (
|
||||
assign NAMask[1:0] = {2'b11};
|
||||
|
||||
prioritythemometer #(`PA_BITS-2) namaskgen(
|
||||
.a({PMPAdr[`PA_BITS-4:0], (AdrMode == NAPOT)}),
|
||||
.a({~PMPAdr[`PA_BITS-4:0], (AdrMode == NAPOT)}), // *** confusing bit bussing to match the logic for the inside of the thermometer.
|
||||
.y(NAMask[`PA_BITS-1:2]));
|
||||
|
||||
assign NAMatch = &((PhysicalAddress ~^ CurrentAdrFull) | NAMask);
|
||||
|
@ -40,13 +40,16 @@ module priorityonehot #(parameter ENTRIES = 8) (
|
||||
logic [ENTRIES-1:0] nolower;
|
||||
|
||||
// generate thermometer code mask
|
||||
genvar i;
|
||||
generate
|
||||
assign nolower[0] = 1'b1;
|
||||
for (i=1; i<ENTRIES; i++) begin:therm
|
||||
assign nolower[i] = nolower[i-1] & ~a[i-1];
|
||||
end
|
||||
endgenerate
|
||||
prioritythemometer #(ENTRIES) maskgen(.a({a[ENTRIES-2:0], 1'b1}), .y(nolower));
|
||||
// genvar i;
|
||||
// generate
|
||||
// assign nolower[0] = 1'b1;
|
||||
// for (i=1; i<ENTRIES; i++) begin:therm
|
||||
// assign nolower[i] = nolower[i-1] & ~a[i-1];
|
||||
// end
|
||||
// endgenerate
|
||||
// *** replace mask generation logic ^^^ with priority thermometer
|
||||
|
||||
|
||||
assign y = a & nolower;
|
||||
|
||||
|
@ -37,16 +37,20 @@ module prioritythemometer #(parameter N = 8) (
|
||||
output logic [N-1:0] y
|
||||
);
|
||||
|
||||
// Carefully crafted so design compiler would synthesize into a fast tree structure
|
||||
// Rather than linear.
|
||||
|
||||
// generate thermometer code mask
|
||||
genvar i;
|
||||
generate
|
||||
assign y[0] = a[0];
|
||||
for (i=1; i<N; i++) begin
|
||||
assign y[i] = y[i-1] & a[i];
|
||||
for (i=1; i<N; i++) begin:therm
|
||||
assign y[i] = y[i-1] & ~a[i]; // *** made to be the same as onehot (without the inverter) to see if the probelme is something weird with synthesis
|
||||
// assign y[i] = y[i-1] & a[i];
|
||||
end
|
||||
endgenerate
|
||||
|
||||
|
||||
endmodule
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user