+++ /dev/null
-package edu.berkeley.fleet.marina;
-import com.sun.electric.tool.simulation.test.*;
-
-
-/**
- * An item-counter which counts items that pass by in one of the
- * circular fifos.
- */
-public class Counter {
- private final String dataChain, dataPath;
- private final ChainControl cc;
- public Counter(String cntrInst, String dataChain, ChainControl cc) {
- this.dataChain = dataChain;
- this.dataPath = dataChain+'.'+cntrInst;
- this.cc = cc;
- }
- /** Read a new value from the Counter */
- public long getCount() {
- cc.shift(dataChain, true, false);
- return 0;
- // do nothing because I counter schematics don't yet exist
- //long cnt = cc.getOutBits(dataPath).bitReverse().not().toLong();
- }
- /** Set counter value to zero */
- public void clearCount() {
-
- }
-
-}
return ans;
}
private void stopToStop(ProperStopper s1, ProperStopper s2,
- Counter ctr,
List<BitVector> din) {
prln("Begin stopToStop");
adjustIndent(2);
s1.stop();
- long ctrStart = ctr==null ? 0 : ctr.getCount();
+ long ctrStart = 0;
s1.fillMany(din);
waitUntilQuiescent();
MarinaUtils.compareItemsOrdered(din, dout);
- if (ctr!=null) {
- long ctrEnd = ctr.getCount();
- long delta = ctrEnd - ctrStart;
- long expect = din.size();
- fatal(delta!=expect,
- "counter delta wrong: expected delta: "+expect+
- " counter before:"+ctrStart+" counter after:"+ctrEnd);
- }
-
adjustIndent(-2);
prln("End stopToStop");
}
* is then run to allow the burst to flow. */
private void stopToStopBurst(ProperStopper src, ProperStopper gate,
ProperStopper dst,
- Counter ctr,
List<BitVector> din) {
prln("Begin stopToStopBurst test");
adjustIndent(2);
src.stop();
gate.stop();
- long ctrStart = ctr==null ? 0 : ctr.getCount();
+ long ctrStart = 0;
src.fillMany(din);
waitUntilQuiescent();
MarinaUtils.compareItemsOrdered(din, dout);
- if (ctr!=null) {
- long ctrEnd = ctr.getCount();
- long delta = ctrEnd - ctrStart;
-
- long expectA = din.size();
- fatal(delta!=expectA,
- "counter delta wrong: expected delta: "+expectA+
- " counter before:"+ctrStart+" counter after:"+ctrEnd);
- }
-
adjustIndent(-2);
prln("End stopToStopBurst test");
}
private void stopToStopOne(ProperStopper s1, ProperStopper s2,
- Counter ctr, int adr) {
+ int adr) {
prln("Begin stopToStopOne");
adjustIndent(2);
List<BitVector> din = makeIncrDataConstAdr(1, adr);
- stopToStop(s1, s2, ctr, din);
+ stopToStop(s1, s2, din);
adjustIndent(-2);
prln("End stopToStopOne");
}
private void stopToStopThree(ProperStopper s1, ProperStopper s2,
- Counter ctr, int adr) {
+ int adr) {
prln("Begin stopToStopOne");
adjustIndent(2);
List<BitVector> din = makeIncrDataConstAdr(3, adr);
- stopToStop(s1, s2, ctr, din);
+ stopToStop(s1, s2, din);
adjustIndent(-2);
prln("End stopToStopOne");