summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-08-29 15:23:34 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-08-29 15:23:34 +0200
commit9a5e79dfd1c6829b052ab7cf0cb7a79afd25eb72 (patch)
treedfa287746b7a714cd6c1af2c04d7e2fd4d189d08 /instance-calculator/src/VHDLComponent.java
parent35e6857fb09b006da9f8cc3f59f239f078cc69a1 (diff)
Should now load the model.
Diffstat (limited to 'instance-calculator/src/VHDLComponent.java')
-rw-r--r--instance-calculator/src/VHDLComponent.java51
1 files changed, 36 insertions, 15 deletions
diff --git a/instance-calculator/src/VHDLComponent.java b/instance-calculator/src/VHDLComponent.java
index 5972173..b0f8de2 100644
--- a/instance-calculator/src/VHDLComponent.java
+++ b/instance-calculator/src/VHDLComponent.java
@@ -17,25 +17,31 @@ public class VHDLComponent
}
}
- public static boolean handle_is_component_of
- (
- final String cmp_id,
- final String e_id
- )
+ public static VHDLComponent get_from_id (final String id)
{
- /* TODO */
- return false;
+ final VHDLComponent result;
+
+ result = FROM_ID.get(id);
+
+ if (result == null)
+ {
+ System.err.println
+ (
+ "[E] Element "
+ + id
+ + " is used like a component instantiation, but is not declared as"
+ + " such before that use."
+ );
+
+ System.exit(-1);
+ }
+
+ return result;
}
- public static boolean handle_port_maps
- (
- final String cmp_id,
- final String pt_id,
- final String wfm_id
- )
+ public static VHDLComponent find (final String id)
{
- /* TODO */
- return false;
+ return FROM_ID.get(id);
}
/******************************************************************************/
@@ -45,6 +51,21 @@ public class VHDLComponent
private VHDLEntity destination;
private VHDLArchitecture parent;
+ public void set_destination (final VHDLEntity dest)
+ {
+ destination = dest;
+ }
+
+ public void set_architecture (final VHDLArchitecture arch)
+ {
+ parent = arch;
+ }
+
+ public void add_port_map (final String src, final String dest)
+ {
+ port_map.put(src, dest);
+ }
+
public void add_instance_content_to
(
final Collection<VHDLProcess.Instance> process_instances,