[Libre-soc-bugs] [Bug 450] Create MMU from microwatt mmu.vhdl
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Fri Aug 14 20:37:46 BST 2020
https://bugs.libre-soc.org/show_bug.cgi?id=450
--- Comment #50 from Cole Poirier <colepoirier at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #49)
> (In reply to Cole Poirier from comment #48)
> > Sorry that's not that helpful, can you expand on this.
>
> apologies, i assumed you'd know to expand "..." in the way that all typedefs
> (c and other languages) work.
Aha! Thanks very much for taking the time to explain this to me, I’m learning a
lot very quickly, but I am still very ignorant.
> wherever you see a subtype, LITERALLY replace the subtype with its
> declaration.
Ok, that makes sense.
> subtype way_t is integer range 0 to NUM_WAYS-1;
>
> subtype cache_tag_t is std_logic_vector(TAG_BITS-1 downto 0);
>
> type cache_tags_set_t is array(way_t) of cache_tag_t;
> type cache_tags_array_t is array(index_t) of cache_tags_set_t;
>
>
> becomes
>
>
>
> subtype cache_tag_t is std_logic_vector(TAG_BITS-1 downto 0);
>
> type cache_tags_set_t is array(range 0 to NUM_WAYS-1;) of cache_tag_t;
> type cache_tags_array_t is array(index_t) of cache_tags_set_t;
>
>
>
> becomes
>
>
> type cache_tags_set_t is array(range 0 to NUM_WAYS-1;) of
> std_logic_vector(TAG_BITS-1 downto 0);
>
> type cache_tags_array_t is array(index_t) of cache_tags_set_t;
>
>
> becomes
>
>
>
> type cache_tags_array_t is array(index_t) of
> array(range 0 to NUM_WAYS-1;) of std_logic_vector(TAG_BITS-1 downto 0);
>
>
>
> and the substitution is now complete as far as you have given.
>
> of course, it is itself also a type, therefore there will be an additional
> substitution.
That’s very helpful, thank you.
> translating that to nmigen, will invve a 2D Array of Signals.
The above us all helpful but I think this is the key insight. AFK right now but
will try this shortly and get back to you with a more useful question. Thanks
Luke :)
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list