mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
changed tlbphysicalpagemask to structural
This commit is contained in:
parent
fd0cd930a7
commit
f960561cbb
@ -40,8 +40,19 @@ module tlbphysicalpagemask (
|
|||||||
logic [`PPN_BITS-1:0] PageNumberMask;
|
logic [`PPN_BITS-1:0] PageNumberMask;
|
||||||
|
|
||||||
generate
|
generate
|
||||||
if (`XLEN == 32) begin
|
if (`XLEN == 32)
|
||||||
always_comb
|
// kilopage: 22 bits of PPN, 0 bits of VPN
|
||||||
|
// megapage: 12 bits of PPN, 10 bits of VPN
|
||||||
|
mux2 #(22) pnm(22'h3FFFFF, 22'h3FFC00, PageType[0], PageNumberMask);
|
||||||
|
else
|
||||||
|
// kilopage: 44 bits of PPN, 0 bits of VPN
|
||||||
|
// megapage: 35 bits of PPN, 9 bits of VPN
|
||||||
|
// gigapage: 26 bits of PPN, 18 bits of VPN
|
||||||
|
// terapage: 17 bits of PPN, 27 bits of VPN
|
||||||
|
mux4 #(44) pnm(44'hFFFFFFFFFFF, 44'hFFFFFFFFE00, 44'hFFFFFFC0000, 44'hFFFF8000000, PageType, PageNumberMask);
|
||||||
|
endgenerate
|
||||||
|
/* always_comb
|
||||||
|
|
||||||
case (PageType[0])
|
case (PageType[0])
|
||||||
// the widths of these constansts are hardocded here to match `PPN_BITS in the wally-constants file.
|
// the widths of these constansts are hardocded here to match `PPN_BITS in the wally-constants file.
|
||||||
0: PageNumberMask = 22'h3FFFFF; // kilopage: 22 bits of PPN, 0 bits of VPN
|
0: PageNumberMask = 22'h3FFFFF; // kilopage: 22 bits of PPN, 0 bits of VPN
|
||||||
@ -59,7 +70,7 @@ module tlbphysicalpagemask (
|
|||||||
// in the tlb when it generates VPN from the full virtualadress.
|
// in the tlb when it generates VPN from the full virtualadress.
|
||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
endgenerate
|
endgenerate */
|
||||||
|
|
||||||
// merge low segments of VPN with high segments of PPN decided by the pagetype.
|
// merge low segments of VPN with high segments of PPN decided by the pagetype.
|
||||||
assign ZeroExtendedVPN = {{EXTRA_BITS{1'b0}}, VPN}; // forces the VPN to be the same width as PPN.
|
assign ZeroExtendedVPN = {{EXTRA_BITS{1'b0}}, VPN}; // forces the VPN to be the same width as PPN.
|
||||||
|
Loading…
Reference in New Issue
Block a user