Cache memory

Moderator (Company: Titel) #3645800
Rate this post
• ▲ useful
▼ not useful
Mionxsq Lopbc wrote:
> but it's not working.
How did you find that out? What do you expect and what do you get?

Just a little hint: VHDL is not C!!!
(I cannot make enough exclamation marks!!)
What you did is a kind of controller that may be working if it is 
executed sequentially on a CPU. But it will never work as you expect on 
hardware with VHDL. Read my comments...
1
         if (Valid='1') then
2
            -- forget about functions the first half year of your VHDL career. 
3
            -- if you don't want to write the mux inline, then have a look for "components" and "component instantiation"
4
            DataProc<=mux4x1(Cache_OUT(15 downto 0),Cache_OUT(31 downto 16), Cache_OUT(47 downto 32),Cache_OUT(63 downto 48),Palavra); 
5
            ...
6
         else   -- to come here Valid must be '0'
7
             Valid <= validade(V,TAG1,TAG2); -- 
8
             if (Valid='1') then -- the following code will NEVER be  "reached", 
9
                                 -- because a SIGNAL in VHDL behaves not the way you want. 
10
                                 -- Here /Valid/ is '0', because the "new" value of /Valid/ 
11
                                 -- is updated at the end of the process.
12
                 ...
OP #3647762
Rate this post
• ▲ useful
▼ not useful
These ones

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.