Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

VHDL equivalence

Altera_Forum
Honored Contributor II
2,034 Views

Hi, 

 

I wonder what is the equivalence of this Verilog statement? 

 

assign data = (cs && oe && ! we) ? data_out : 8'bz;
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
1,212 Views

I'm guessing 

 

data <= data_out when cs = '1' and oe = '1' and we = '0' else (others => 'Z'); 

 

I don't personally speak Verilog but I'm guessing that the gist is: when the boolean expression "cs and oe and not we" is 1, assign data_out to data otherwise tri-state data. I hope that's nough to make sense of the VHDL above anyway.
0 Kudos
Altera_Forum
Honored Contributor II
1,212 Views

THanks Batflink! It should be it.

0 Kudos
Altera_Forum
Honored Contributor II
1,212 Views

Sorry I should have said that the above only applies if you are trying to construct a stand-alone concurrent statement. If this is a line in a process then you need to use an "if" clause, i.e: 

 

process (clk) begin if rising_edge (clk) then if (cs = '1' and oe = '1' and we = '0' ) then data <= data_out; else data <= (others => 'Z'); end if; end if; end process;
0 Kudos
Altera_Forum
Honored Contributor II
1,212 Views

 

--- Quote Start ---  

I should have said that the above only applies if you are trying to construct a stand-alone concurrent statement 

--- Quote End ---  

That's the same with Verilog assign. It doesn't work in an always block.
0 Kudos
Reply