Bug with Hardware Simulator

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug with Hardware Simulator

Frank
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?
Reply | Threaded
Open this post in threaded view
|

Re: Bug with Hardware Simulator

cadet1620
Administrator
I remember running into similar issues when I was experimenting with creating a "writable ROM" -- a ROM with a writeback cache so that it appeared to be RAM.  IIRC I ended up inlining everything.

I've done some hack variants in LogiSim
    http://ozark.hendrix.edu/~burch/logisim/

--Mark