+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Member level 1
    Points: 172, Level: 2

    Join Date
    Jul 2017
    Posts
    34
    Helped
    0 / 0
    Points
    172
    Level
    2

    VHDL Equivalent of Verilog Code

    Hi,
    Please anyone tell me the VHDL equivalent for the below verilog code.

    Code Verilog - [expand]
    1
    
    assign  ifc_cle = (cpu_rst_n & (~rst_hold_f) & ((req_md_r == 2'b11)? req_rst_r : 1'b1))? 1'bz : (boot_override_r? rcw_src_r[8] : 1'bz);

    •   Alt31st July 2017, 12:44

      advertising

        
       

  2. #2
    Advanced Member level 5
    Points: 33,920, Level: 44
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,209
    Helped
    1816 / 1816
    Points
    33,920
    Level
    44

    Re: VHDL Equivalent of Verilog Code

    You are trying to translate some really badly written Verilog. I suggest you find a better source, or a Verilog tutorial/reference book. Or better still - understand what you're trying to do and write your own.

    Im going to give a direct translation, written in equally bad formatting (though I assume you'll just copy and paste anyway, rather than try and understand it):

    Code VHDL - [expand]
    1
    
    ifc_cle <= 'Z' when cpu_rst_n = '1' and rst_hold_f = '0' and ( (req_md_r = "11" and req_rst_t = '1') or req_md_r /= "11" ) else rcw_src_r(8) when boot_override_r = '1' else 'Z';

    - - - Updated - - -

    and here is the improved VHDL 2008 version:

    Code VHDL - [expand]
    1
    
    ifc_cle <= 'Z' when ??(cpu_rst_n  and not rst_hold_f) and ( (req_md_r = "11" and ??req_rst_t ) or req_md_r /= "11" ) ) else rcw_src_r(8) when ??boot_override_r else 'Z';



--[[ ]]--