[Libre-soc-bugs] [Bug 469] Create D-cache from microwatt dcache.vhdl

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Mon Aug 24 12:43:46 BST 2020


https://bugs.libre-soc.org/show_bug.cgi?id=469

--- Comment #10 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Luke Kenneth Casson Leighton from comment #8)
> 
> szNUM_WAYS = log2_int(NUM_WAYS)
> self.hit_way   = Signal(szNUM_WAYS)

commit b8e1e712b6aa41fa2f084bceb808672804a4abdc (HEAD -> master)
Author: Luke Kenneth Casson Leighton <lkcl at lkcl.net>
Date:   Mon Aug 24 12:37:32 2020 +0100

    use WAY_BITS in appropriate locations


ok.

* numbers are in binary and way_t is declared as 0..NUM_WAYS-1
* therefore it takes log2_int(NUM_WAYS) bits to *store* a number in a Signal
  that will cover all values 0..NUM_WAYS-1
* turns out that WAY_BITS has already been assigned to log2_int(NUM_WAYS).
* therefore Signals of type "way_t" must be declared as Signal(WAY_BITS)

you'll need to be very patient and focussed, going step-by-step and blocking
out everything other than what you are focussing on.

bear in mind that a for-loop from 0 to NUM_WAYS-1 is *not* to replaced with
WAY_BITS i.e. this is... errr... not correct

#                 for i in way_t loop
                for i in range(WAY):

_this_ is correct:

#                 for i in way_t loop
                for i in range(NUM_WAYS):


commit b45fab94d8370ef8297b9bb303bf0d6fc161193e (HEAD -> master)
Author: Luke Kenneth Casson Leighton <lkcl at lkcl.net>
Date:   Mon Aug 24 12:43:34 2020 +0100

    "WAY" does not exist - range(NUM_WAYS) was intended

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list