I am confused about VHDL best practices - for example, when to use integer or real or signal or std_logic_vector .
You cannot use real for synthesis (i.e. not for anything that ends in a real chip)
Use integer or signed or unsigned when you need to do arithmetic of values. Use std_logic[_vector] only when you need port pins that can handle high impedance. Use std_ulogic[_vector] if you need one bit or bag-bit inside. The advantage of std_ulogic is that only one can control the signal by definition, so if you make a mess and control it from two places, the compiler will tell you. Otherwise, you have a simulation full of X in the waveform viewer and don't know where they came from.
signal are used to pass values ββbetween different function blocks (either entity blocks or process blocks). variable are used in processes to track things.
How to connect all my components to VHDL (register file, apu, memory, ...)?
With signals. Sigasi editor makes this a lot easier (less typed )
Do not create a component - you already have an entity , use direct instantiation:
ALU1 : entity work.alu port map ( clk => clk, etc... );
VHDL code that has the specified delay until the value is displayed. when should i do this in datapath MIPS?
You do not want to specify delays - they are ignored in the synthesis, and if your design is completely synchronous (all this is a synchronized process with one hour running all over the place), the compiler will sort the real delays for you later, you can abstract above this.
source share