self.lsui_busy = Signal()
self.valid_l = SRLatch(False, name="valid")
- def set_wr_addr(self, m, addr, mask, misalign, msr_pr):
+ def set_wr_addr(self, m, addr, mask, misalign, msr_pr, is_dcbz):
m.d.comb += self.valid_l.s.eq(1)
m.d.comb += self.lsui.x_mask_i.eq(mask)
m.d.comb += self.lsui.x_addr_i.eq(addr)
def connect_port(self, inport):
return self.pi.connect_port(inport)
- def set_wr_addr(self, m, addr, mask, misalign, msr_pr): pass
+ def set_wr_addr(self, m, addr, mask, misalign, msr_pr, is_dcbz): pass
def set_rd_addr(self, m, addr, mask, misalign, msr_pr): pass
def set_wr_data(self, m, data, wen): pass
def get_rd_data(self, m): pass
comb += pi.addr_ok_o.eq(1) # acknowledge addr ok
sync += adrok_l.s.eq(1) # and pull "ack" latch
- # if now in "DCBZ" mode: wait for addr_ok, then send the address out
- # to memory, acknowledge address, and send out LD data
- #with m.If(dcbz_active.q):
- ##comb += Display("dcbz active")
- # XXX Please don't do it this way, not without discussion
- # the exact same address is required to be set by both
- # dcbz and stores, so use the exact same function.
- # it would be better to add an extra argument to
- # set_wr_addr to indicate "dcbz mode".
- #self.___use_wr_addr_instead_set_dcbz_addr(m, pi.addr.data)
-
# if now in "ST" mode: likewise do the same but with "ST"
# to memory, acknowledge address, and send out LD data
with m.If(st_active.q):
comb += lenexp.len_i.eq(pi.data_len)
comb += lenexp.addr_i.eq(lsbaddr)
with m.If(pi.addr.ok):
- self.set_wr_addr(m, pi.addr.data, lenexp.lexp_o, misalign, pr)
+ is_dcbz = 0 # fixme
+ self.set_wr_addr(m, pi.addr.data, lenexp.lexp_o, misalign, pr, is_dcbz)
with m.If(adrok_l.qn):
comb += pi.addr_ok_o.eq(1) # acknowledge addr ok
sync += adrok_l.s.eq(1) # and pull "ack" latch
super().__init__(regwid, addrwid)
self.ldst = LDSTSplitter(32, 48, 4)
- def set_wr_addr(self, m, addr, mask, misalign, msr_pr):
+ def set_wr_addr(self, m, addr, mask, misalign, msr_pr, is_dcbz):
m.d.comb += self.ldst.addr_i.eq(addr)
def set_rd_addr(self, m, addr, mask, misalign, msr_pr):
self.mmu = mmu
self.dcache = dcache
- def set_wr_addr(self, m, addr, mask, misalign, msr_pr):
+ def set_wr_addr(self, m, addr, mask, misalign, msr_pr, is_dcbz):
m.d.comb += self.dcache.d_in.addr.eq(addr)
m.d.comb += self.mmu.l_in.addr.eq(addr)
m.d.comb += self.mmu.l_in.load.eq(0)
#self.nia = Signal(64)
#self.srr1 = Signal(16)
- # XXX please don't do it this way (and ask in future).
- # the exact same logic is required for setting store addresses
- # as for dcbz addresses, therefore why duplicate code?
- # it would be better to add an argument to set_wr_addr to
- # specifiy that it requires dcbz mode to be set.
- def __please_remove_and_use_set_wr_addr_instead_set_dcbz_addr(self, m, addr):
- m.d.comb += self.req.load.eq(0) #not a load operation
- m.d.comb += self.req.dcbz.eq(1)
- #m.d.comb += self.req.byte_sel.eq(mask)
- m.d.comb += self.req.addr.eq(addr)
- m.d.comb += Display("set_dcbz_addr %i",addr)
- #m.d.comb += self.req.priv_mode.eq(~msr_pr) # not-problem ==> priv
- #m.d.comb += self.req.virt_mode.eq(msr_pr) # problem-state ==> virt
- #m.d.comb += self.req.align_intr.eq(misalign)
- return None
-
- # XXX please add a dcbz argument to all set_wr_addr functions instead.
- def set_wr_addr(self, m, addr, mask, misalign, msr_pr):
+ def set_wr_addr(self, m, addr, mask, misalign, msr_pr, is_dcbz):
m.d.comb += self.req.load.eq(0) # store operation
m.d.comb += self.req.byte_sel.eq(mask)
m.d.comb += self.req.addr.eq(addr)
m.d.comb += self.req.priv_mode.eq(~msr_pr) # not-problem ==> priv
m.d.comb += self.req.virt_mode.eq(msr_pr) # problem-state ==> virt
m.d.comb += self.req.align_intr.eq(misalign)
+ m.d.comb += self.req.dcbz.eq(is_dcbz)
# option to disable the cache entirely for write
if self.disable_cache: