I'm attempting to port discrete schematics into a FPGA. In the schematics some AND gates function as short pulse generators, when input goes low output is enabled, until input propagates down an inverter chain and disables the gate (Similar to the answer described here.) Thus a short pulse is produced every negative edge. I'm new to Verilog, and am not sure of the best way to recreate this effect in Verilog. Would the code below work and is it a proper solution?
module pulser(input in,output out);
reg mem;
assign out = mem & !in;
always @(negedge in) begin
mem <= 0;
end
always @(posedge in) begin
mem <= 1;
end
endmodule
assign mem = in;. Unfortunately timing of gates in FPGAs is not particularly predictable, and FPGA synthesis tools aren't designed to play the kind of trick that might have been used in the old discrete logic design. You'll probably have to use a substantially different approach to achieve the same overall function in an FPGA. (Hint: if you have a clock signal available, you almost certainly want to use it here. If you don't have one, you want to add one to your design) – The Photon Jan 19 '19 at 05:12