|
I am playing around with using a Memory chip as a component of a bigger chip, and everything works if I hook up the output of the Memory chip directly to the output, but not if I pass it through an And16 gate first. In other words,
CHIP MemoryModified1 {
IN in[16], load, address[15];
OUT out[16];
PARTS:
Memory(in=in, load=load, address=address, out=out);
}
passes the given Memory.tst but
CHIP MemoryModified2 {
IN in[16], load, address[15];
OUT out[16];
PARTS:
Memory(in=in, load=load, address=address, out=outtemp);
And16(a=outtemp, b=true, out=out);
}
hangs on the keyboard input (but passes every check before that).
What's even stranger is that if I copy the Memory implementation into the body, then the tests pass just fine as in
CHIP MemoryModified3 {
IN in[16], load, address[15];
OUT out[16];
PARTS:
.. Memory implementation goes here, except with out renamed to outtemp ..
And16(a=outtemp, b=true, out=out);
}
This leads me to suspect that there is a bug with the hardware emulator (in comparison mode) not detecting that the output of Memory is clocked (as Memory is not a built-in chip). If the clocked-ness of the output of Memory were properly detected (as with the other clocked built-ins used by Memory) then chip MemoryModified2 should work just fine. Any thoughts?
|