mowiehowie
Junior Member
![* *](https://designers-guide.org/forum/Templates/Forum/default/starblue.gif)
Offline
Posts: 26
|
hi all. i need to detect a falling edge in order to count it and generate a signal. i've made a code like this: analog begin
@(initial_step) begin
cycle = 0; carrega = 0; k = 0; serial = 0; vth = 0.9*V(dvdd,dgnd); end
@(cross(V(clk)-vth, 1)) begin
if (cycle < 71) cycle = cycle + 1; $strobe(cycle); if (cycle <= 70) serial = $table_model(cycle, "testvector.dat", "D"); if (cycle == 71) cycle = 0;
end
@(cross(V(clk)-vth, -1)) begin
if (k < 71) k = k + 1; $strobe(k); if (k == 71) carrega = 1; k = 0;
end
V(out_d,dgnd) <+ serial*V(dvdd,dgnd); V(load,dgnd) <+ carrega*V(dvdd,dgnd);
end
endmodule in fact, i can see that the rising edge is detected properly but the falling edge is not. k only reaches '1'. it doesnt increase anymore.
what might be going on?
|