| summaryrefslogtreecommitdiff | 
path: root/instance-calculator
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-08-28 16:27:12 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-08-28 16:27:12 +0200 | 
| commit | ee9d405bc917be3f596ccd2ffd2d7ddc01687d31 (patch) | |
| tree | f9287d5bc3cd50f7251e459751e49043d0e54525 /instance-calculator | |
| parent | 2a13a7957f08429c8b5c905032b26c51de57885f (diff) | |
Starts the Instance Calculator
Diffstat (limited to 'instance-calculator')
| -rw-r--r-- | instance-calculator/Makefile | 69 | ||||
| -rw-r--r-- | instance-calculator/src/.java_classpath | 1 | ||||
| -rw-r--r-- | instance-calculator/src/VHDLArchitecture.java | 22 | ||||
| -rw-r--r-- | instance-calculator/src/VHDLComponent.java | 21 | ||||
| -rw-r--r-- | instance-calculator/src/VHDLEntity.java | 21 | ||||
| -rw-r--r-- | instance-calculator/src/VHDLProcess.java | 21 | 
6 files changed, 155 insertions, 0 deletions
| diff --git a/instance-calculator/Makefile b/instance-calculator/Makefile new file mode 100644 index 0000000..8da7891 --- /dev/null +++ b/instance-calculator/Makefile @@ -0,0 +1,69 @@ +## Parameters ################################################################## +#### Where to find the model +ifndef MODEL_DIR +MODEL_DIR = +endif + +#### Where to store the Instance model +ifndef INSTANCE_MODEL_DIR +INSTANCE_MODEL_DIR = +endif + +#### Binaries +###### JRE binary +ifndef JAVA +JAVA = java +endif + +###### JDK binary +ifndef JAVAC +JAVAC = javac +endif + +## Parameters Sanity Check ##################################################### +ifeq ($(strip $(MODEL_DIR)),) +$(error No MODEL_DIR defined as parameter.) +endif + +ifeq ($(strip $(INSTANCE_MODEL_DIR)),) +$(error No INSTANCE_MODEL_DIR defined as parameter.) +endif + +ifeq ($(strip $(JAVA)),) +$(error No Java executable defined as parameter.) +endif + +ifeq ($(strip $(JAVAC)),) +$(error No Java compiler defined as parameter.) +endif + +################################################################################ +CLASSPATH = "./src/" + +## Makefile Magic ############################################################## +SOURCES = $(wildcard src/*.java) +CLASSES = $(SOURCES:.java=.class) +MODEL_FILES = $(MODEL_DIR)/structural.mod +OUTPUT_FILE = $(INSTANCE_MODEL_DIR)/instances.mod + +## Makefile Rules ############################################################## +compile: $(CLASSES) + +model: $(CLASSES) $(INSTANCE_MODEL_DIR) $(OUTPUT_FILE) + +clean: +	rm -f $(CLASSES) +	rm -f $(PATH_MODEL_DIR)/*.mod + +clean_model: +	rm -f $(PATH_MODEL_DIR)/*.mod +######## +%.class: %.java +	$(JAVAC) -cp $(CLASSPATH) $< + +$(OUTPUT_FILE): $(MODEL_FILE) $(CLASSES) +	$(JAVA) -cp $(CLASSPATH) Main $< $@ + +$(INSTANCE_MODEL_DIR): +	mkdir -p $(INSTANCE_MODEL_DIR) + diff --git a/instance-calculator/src/.java_classpath b/instance-calculator/src/.java_classpath new file mode 100644 index 0000000..5e14ac9 --- /dev/null +++ b/instance-calculator/src/.java_classpath @@ -0,0 +1 @@ +../kodkod.jar diff --git a/instance-calculator/src/VHDLArchitecture.java b/instance-calculator/src/VHDLArchitecture.java new file mode 100644 index 0000000..ffd678c --- /dev/null +++ b/instance-calculator/src/VHDLArchitecture.java @@ -0,0 +1,22 @@ +import java.util.*; + +public class VHDLArchitecture +{ +   private static final Map<String, VHDLArchitecture> FROM_ID; + +   static +   { +      FROM_ID = new HashMap<String, VHDLArchitecture>(); +   } + +   private final List<String> processes; +   private final List<String> components; +   private final String id; + +   private VHDLArchitecture (final String id) +   { +      this.id = id; + +      ports = new ArrayList<String>(); +   } +} diff --git a/instance-calculator/src/VHDLComponent.java b/instance-calculator/src/VHDLComponent.java new file mode 100644 index 0000000..29261a7 --- /dev/null +++ b/instance-calculator/src/VHDLComponent.java @@ -0,0 +1,21 @@ +import java.util.*; + +public class VHDLComponent +{ +   private static final Map<String, VHDLComponent> FROM_ID; + +   static +   { +      FROM_ID = new HashMap<String, VHDLComponent>(); +   } + +   private final Map<String, String> port_map; +   private final String id; + +   private VHDLComponent (final String id) +   { +      this.id = id; + +      port_map = new HashMap<String, String>(); +   } +} diff --git a/instance-calculator/src/VHDLEntity.java b/instance-calculator/src/VHDLEntity.java new file mode 100644 index 0000000..c8fa332 --- /dev/null +++ b/instance-calculator/src/VHDLEntity.java @@ -0,0 +1,21 @@ +import java.util.*; + +public class VHDLEntity +{ +   private static final Map<String, VHDLEntity> FROM_ID; + +   static +   { +      FROM_ID = new HashMap<String, VHDLEntity>(); +   } + +   private final List<String> ports; +   private final String id; + +   private VHDLEntity (final String id) +   { +      this.id = id; + +      ports = new ArrayList<String>(); +   } +} diff --git a/instance-calculator/src/VHDLProcess.java b/instance-calculator/src/VHDLProcess.java new file mode 100644 index 0000000..f2f27e7 --- /dev/null +++ b/instance-calculator/src/VHDLProcess.java @@ -0,0 +1,21 @@ +import java.util.*; + +public class VHDLProcess +{ +   private static final Map<String, VHDLProcess> FROM_ID; + +   static +   { +      FROM_ID = new HashMap<String, VHDLProcess>(); +   } + +   private final List<String> accessed_wfm; +   private final String id; + +   private VHDLProcess (final String id) +   { +      this.id = id; + +      ports = new ArrayList<String>(); +   } +} | 


