What is the proper way to add delays to this model of a 74hct151 - see below. See also my effort at a solution.
I would like to see even one fully accurate (as possible) verilog model of 7400 timings so I could understand the concerns and build my own. The 74151 is interesting because the Y and _Y paths have different times and also because it's the most recent one I've needed for my homebrew"TTL" cpu.
I am using Icarus so I need a solution for that. I don't have other tools and I know that some tools have bugs/quirks/missing features so something that works on a commercial tool but not Icarus is an issue.
I am hoping someone would show me a solution so I can learn.
I do have a solution below but I think it's probably bit pants.
I want a design that allows through realistic glitches.but my earlier attempts suppressed short glitches due to how I was doing delays. I believe this is called "transport delay" as opposed to "inertial delay".
As mentioned in the following document using transport delays is useful for finding glitch risks.. section 4.3 https://www.google.co.uk/url?sa=t&source=web&rct=j&url=http://cs.baylor.edu/~maurer/aida/desauto/chapter4.pdf&ved=2ahUKEwjYtpS06pHsAhUEXRUIHVtJAos4FBAWMAB6BAgAEAE&usg=AOvVaw1CUNhobqxQe-pQIEZiBKm_
With correct delays I am expecting to see a transition glitch on the Y/_Y during certain transitions due to the difference in the S and I propagation delay.
The data sheet says this chips glitches during transitions and this shows up in my best shot at the timings
These needed delays are taken from datasheet for HCT in ns
I to Y = 19
I to _Y = 19
S to Y = 20
S to _Y = 20
_E to Y = 16
_E to _Y = 18
transition time Y, _Y = 7
See also https://assets.nexperia.com/documents/data-sheet/74HC_HCT151_Q100.pdf
The basic code below has no delays.
How do I implement correctly?
See edaplayground link above for my novice solution.
I expect there is a more idiomatic way to get these timings.
Here is the basic logic without delays....
`timescale 1ns/1ns
module hct74151(_E, I, S, Y, _Y);
output Y, _Y;
input [2:0] S;
input [7:0] I;
input _E;
wire o =
(S==0 & I[0]) ||
(S==1 & I[1]) ||
(S==2 & I[2]) ||
(S==3 & I[3]) ||
(S==4 & I[4]) ||
(S==5 & I[5]) ||
(S==6 & I[6]) ||
(S==7 & I[7]);
assign Y = _E==0 ? o : 0;
assign _Y = !Y;
always @* begin
$display("%9t %m ", $time, "_E=%1b I=%8b S=%1d Y=%b _Y=%b ", _E, I, S, Y, _Y);
end
endmodule
:
specify
block? – Light