From 35e6857fb09b006da9f8cc3f59f239f078cc69a1 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Tue, 29 Aug 2017 13:54:43 +0200 Subject: Still working on the implementation. --- instance-calculator/src/VHDLComponent.java | 60 ++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'instance-calculator/src/VHDLComponent.java') diff --git a/instance-calculator/src/VHDLComponent.java b/instance-calculator/src/VHDLComponent.java index 493ba22..5972173 100644 --- a/instance-calculator/src/VHDLComponent.java +++ b/instance-calculator/src/VHDLComponent.java @@ -23,6 +23,7 @@ public class VHDLComponent final String e_id ) { + /* TODO */ return false; } @@ -33,6 +34,7 @@ public class VHDLComponent final String wfm_id ) { + /* TODO */ return false; } @@ -40,6 +42,64 @@ public class VHDLComponent private final Map port_map; private final String id; + private VHDLEntity destination; + private VHDLArchitecture parent; + + public void add_instance_content_to + ( + final Collection process_instances, + final Collection waveform_instances + ) + { + final Collection dest_process_instances; + final Collection dest_waveform_instances; + final Map wfm_map; + + dest_process_instances = destination.get_process_instances(); + dest_waveform_instances = destination.get_waveform_instances(); + + wfm_map = new HashMap(); + + for (final VHDLWaveform.Instance i_wfm: dest_waveform_instances) + { + final String dest; + final VHDLWaveform.Instance replacement; + + dest = + port_map.get + ( + Waveforms.get_id_from_waveform_id + ( + i_wfm.get_parent().get_id() + ) + ); + + if (dest == null) + { + replacement = i_wfm.get_parent().add_instance(parent.get_entity()); + } + else + { + replacement = + VHDLWaveform.get_from_id(dest).add_instance + ( + parent.get_entity() + ); + } + + wfm_map.put(i_wfm, replacement); + waveform_instances.add(replacement); + } + + for (final VHDLProcess.Instance i_ps: dest_process_instances) + { + process_instances.add + ( + i_ps.add_instance(parent.get_entity(), wfm_map) + ); + } + } + private VHDLComponent (final String id) { this.id = id; -- cgit v1.2.3-70-g09d2