preet
Advanced Member level 4
- Joined
- Jan 10, 2005
- Messages
- 112
- Helped
- 7
- Reputation
- 14
- Reaction score
- 5
- Trophy points
- 1,298
- Activity points
- 908
I am trying to convert this vhdl testbench code to verilog testbench, kindly help me to convert this part of code
slave_clkedge <= '1' when SLAVE_CPHA = SLAVE_CPOL
else '0';
-- Define a 3-bit counter to count SCK edges and data into register so that parallel
-- register is loaded. Use same clock edge that is used to input data
SLAVE_IN_CNTR: process(sck, reset)
begin
-- Clear output register
if (reset = RESET_ACTIVE) then
slave_cnt_int <= (others => '0');
-- On SLAVE_CLKEDGE edge of clock count
elsif sck'event and sck = slave_clkedge then
if ss_n /= ALL_ONES then
slave_cnt_int <= slave_cnt_int + 1;
end if;
end if;
end process;
Regards
slave_clkedge <= '1' when SLAVE_CPHA = SLAVE_CPOL
else '0';
-- Define a 3-bit counter to count SCK edges and data into register so that parallel
-- register is loaded. Use same clock edge that is used to input data
SLAVE_IN_CNTR: process(sck, reset)
begin
-- Clear output register
if (reset = RESET_ACTIVE) then
slave_cnt_int <= (others => '0');
-- On SLAVE_CLKEDGE edge of clock count
elsif sck'event and sck = slave_clkedge then
if ss_n /= ALL_ONES then
slave_cnt_int <= slave_cnt_int + 1;
end if;
end if;
end process;
Regards