projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Wires now can have a name
[Mograsim.git]
/
net.mograsim.logic.core
/
src
/
net
/
mograsim
/
logic
/
core
/
wires
/
Wire.java
diff --git
a/net.mograsim.logic.core/src/net/mograsim/logic/core/wires/Wire.java
b/net.mograsim.logic.core/src/net/mograsim/logic/core/wires/Wire.java
index
89fcb80
..
6e4e50a
100644
(file)
--- a/
net.mograsim.logic.core/src/net/mograsim/logic/core/wires/Wire.java
+++ b/
net.mograsim.logic.core/src/net/mograsim/logic/core/wires/Wire.java
@@
-21,6
+21,7
@@
import net.mograsim.logic.core.types.BitVector.BitVectorMutator;
*/
\r
public class Wire
\r
{
\r
*/
\r
public class Wire
\r
{
\r
+ public final String name;
\r
private BitVector values;
\r
public final int travelTime;
\r
private List<ReadEnd> attached = new ArrayList<>();
\r
private BitVector values;
\r
public final int travelTime;
\r
private List<ReadEnd> attached = new ArrayList<>();
\r
@@
-29,10
+30,16
@@
public class Wire
Timeline timeline;
\r
\r
public Wire(Timeline timeline, int length, int travelTime)
\r
Timeline timeline;
\r
\r
public Wire(Timeline timeline, int length, int travelTime)
\r
+ {
\r
+ this(timeline, length, travelTime, null);
\r
+ }
\r
+
\r
+ public Wire(Timeline timeline, int length, int travelTime, String name)
\r
{
\r
if (length < 1)
\r
throw new IllegalArgumentException(
\r
String.format("Tried to create an array of wires with length %d, but a length of less than 1 makes no sense.", length));
\r
{
\r
if (length < 1)
\r
throw new IllegalArgumentException(
\r
String.format("Tried to create an array of wires with length %d, but a length of less than 1 makes no sense.", length));
\r
+ this.name = name;
\r
this.timeline = timeline;
\r
this.length = length;
\r
this.travelTime = travelTime;
\r
this.timeline = timeline;
\r
this.length = length;
\r
this.travelTime = travelTime;
\r
@@
-491,7
+498,8
@@
public class Wire
@Override
\r
public String toString()
\r
{
\r
@Override
\r
public String toString()
\r
{
\r
- return String.format("wire 0x%08x value: %s inputs: %s", hashCode(), values, inputs);
\r
+ String name = this.name == null ? String.format("0x%08x", hashCode()) : this.name;
\r
+ return String.format("wire %s value: %s inputs: %s", name, values, inputs);
\r
}
\r
\r
public static ReadEnd[] extractEnds(Wire[] w)
\r
}
\r
\r
public static ReadEnd[] extractEnds(Wire[] w)
\r