From 9a5e79dfd1c6829b052ab7cf0cb7a79afd25eb72 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Tue, 29 Aug 2017 15:23:34 +0200 Subject: Should now load the model. --- instance-calculator/src/VHDLWaveform.java | 36 ++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'instance-calculator/src/VHDLWaveform.java') diff --git a/instance-calculator/src/VHDLWaveform.java b/instance-calculator/src/VHDLWaveform.java index 83b9626..1f29b99 100644 --- a/instance-calculator/src/VHDLWaveform.java +++ b/instance-calculator/src/VHDLWaveform.java @@ -19,17 +19,29 @@ public class VHDLWaveform public static VHDLWaveform get_from_id (final String id) { - return FROM_ID.get(id); + final VHDLWaveform result; + + result = FROM_ID.get(id); + + if (result == null) + { + System.err.println + ( + "[E] Element " + + id + + " is used like a waveform, but is not declared as such before" + + " that use." + ); + + System.exit(-1); + } + + return result; } - public static boolean handle_is_accessed_by - ( - final String wfm_id, - final String ps_id - ) + public static VHDLWaveform find (final String id) { - /* TODO */ - return false; + return FROM_ID.get(id); } /******************************************************************************/ @@ -38,12 +50,15 @@ public class VHDLWaveform private final String id; private int instances_count; + private VHDLArchitecture architecture; + private VHDLWaveform (final String id) { this.id = id; accessed_wfm = new ArrayList(); instances = new ArrayList(); instances_count = 0; + architecture = null; } public VHDLWaveform.Instance add_instance @@ -73,6 +88,11 @@ public class VHDLWaveform return id; } + public void set_architecture (final VHDLArchitecture arch) + { + architecture = arch; + } + public static class Instance { private final String id; -- cgit v1.2.3-70-g09d2