Commit 3d8acb6b authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Update templates for simulation

parent 05bf51b5
......@@ -1645,4 +1645,7 @@ filesys.tmplt.
|-
|Used_Shared_Types
|List of actually used shared component types
|-
|Block_Languages
|DOCUMENTATION MISSING
|}
\ No newline at end of file
......@@ -101,3 +101,9 @@ used as a parameter for system.tmplt.
+-----------------------------------+-----------------------------------+
| Glue | DOCUMENTATION MISSING |
+-----------------------------------+-----------------------------------+
| Block_Instance_Of | DOCUMENTATION MISSING |
+-----------------------------------+-----------------------------------+
| Block_Languages | DOCUMENTATION MISSING |
+-----------------------------------+-----------------------------------+
| Block_Names | DOCUMENTATION MISSING |
+-----------------------------------+-----------------------------------+
......@@ -80,6 +80,12 @@ This template is evaluated only once. The output is saved to the Makefile within
|-
|Glue
|DOCUMENTATION MISSING
|-
|CPU_Platform
|DOCUMENTATION MISSING
|-
|Is_FPGA
|DOCUMENTATION MISSING
|}
=== templates/skeletons/context-parameters.tmplt ===
This template is evaluated for every function which has context parameters. The output is saved to the file Context-<function name>.asn
......@@ -1462,6 +1468,15 @@ This file is evaluated for every node. The result of this file is saved to the f
|-
|Glue
|DOCUMENTATION MISSING
|-
|Block_Instance_Of
|DOCUMENTATION MISSING
|-
|Block_Languages
|DOCUMENTATION MISSING
|-
|Block_Names
|DOCUMENTATION MISSING
|}
=== templates/concurrency_view/sub/system.tmplt ===
This file is evaluated for every node. The result of this file is save to the file with name returned by
......
......@@ -64,3 +64,7 @@ Makefile within output directory.
+-----------------------------------+-----------------------------------+
| Glue | DOCUMENTATION MISSING |
+-----------------------------------+-----------------------------------+
| CPU_Platform | DOCUMENTATION MISSING |
+-----------------------------------+-----------------------------------+
| Is_FPGA | DOCUMENTATION MISSING |
+-----------------------------------+-----------------------------------+
......@@ -588,6 +588,9 @@ package body TASTE.Concurrency_View is
VP_Package_Names,
VP_Platforms,
VP_Classifiers : Vector_Tag;
Block_Names, -- All blocks of a node
Block_Languages,
Block_Instance_Of : Vector_Tag;
begin
for Partition in CV.Nodes (Node_Name).Partitions.Iterate loop
Partition_Names := Partition_Names
......@@ -596,6 +599,14 @@ package body TASTE.Concurrency_View is
& Generate_Partition
(Partition_Name => CV_Partitions.Key (Partition),
Node_Name => Node_Name);
for B of CV_Partitions.Element (Partition).Blocks loop
Block_Names := Block_Names &
To_String (B.Ref_Function.Name);
Block_Languages := Block_Languages
& TASTE.Backend.Language_Spelling (B.Ref_Function);
Block_Instance_Of := Block_Instance_Of
& B.Ref_Function.Instance_Of.Value_Or (US (""));
end loop;
end loop;
for VP of CV.Nodes (Node_Name).Deployment_Node.Virtual_CPUs loop
VP_Names := VP_Names & VP.Name;
......@@ -608,15 +619,18 @@ package body TASTE.Concurrency_View is
Join_Sets (CV.Configuration.To_Template,
Drivers_To_Template (CV.Nodes (Node_Name)
.Deployment_Node.Drivers))
& Assoc ("Partitions", Partitions)
& Assoc ("Partition_Names", Partition_Names)
& Assoc ("Has_Memory", Boolean'
& Assoc ("Partitions", Partitions)
& Assoc ("Partition_Names", Partition_Names)
& Assoc ("Has_Memory", Boolean'
(CV.Nodes (Node_Name).Deployment_Node.Memory.Name /= ""))
& Assoc ("VP_Names", VP_Names)
& Assoc ("VP_Package_Names", VP_Package_Names)
& Assoc ("VP_Platforms", VP_Platforms)
& Assoc ("VP_Classifiers", VP_Classifiers)
& Assoc ("Node_Name", Node_Name)
& Assoc ("VP_Names", VP_Names)
& Assoc ("VP_Package_Names", VP_Package_Names)
& Assoc ("VP_Platforms", VP_Platforms)
& Assoc ("VP_Classifiers", VP_Classifiers)
& Assoc ("Node_Name", Node_Name)
& Assoc ("Block_Names", Block_Names)
& Assoc ("Block_Languages", Block_Languages)
& Assoc ("Block_Instance_Of", Block_Instance_Of)
& Assoc ("CPU_Name",
CV.Nodes (Node_Name).Deployment_Node.CPU_Name)
& Assoc ("CPU_Family",
......@@ -631,6 +645,7 @@ package body TASTE.Concurrency_View is
CV.Nodes (Node_Name).Deployment_Node.Package_Name)
& Assoc ("Ada_Runtime",
CV.Nodes (Node_Name).Deployment_Node.Ada_Runtime);
Document_Template
(Templates_Concurrency_View_Sub_Node, Node_Assoc);
return Parse (Path & "/node.tmplt", Node_Assoc);
......
......@@ -30,9 +30,9 @@
../dataview/dataview-uniq.asn
@@END_INLINE@@
@@-- For simulation target, add simulation.asn (common part should be shared)
@@-- For simulation target, add simulation.asn and uPER encoders
@_LOWER:Name_@_simu: @_REPLACE_ALL(,/ ):LOWER:Block_Names_@
@@INLINE( args=")( )("; \\\n mkdir -p ..\/dataview\/Ada; mono $(shell which asn1.exe) -Ada -equal --target allboards -typePrefix asn1Scc -o ..\/dataview\/Ada $$args )@@
@@INLINE( args=")( )("; \\\n mkdir -p ..\/dataview\/Ada; mono $(shell which asn1.exe) -Ada -uPER -equal --target allboards -typePrefix asn1Scc -o ..\/dataview\/Ada $$args )@@
@@TABLE@@
@@IF@@ @_Block_Languages_@ = SDL
@@-- Use wildcard because in the case of the SDL to C backend the _datamodel files are not generated (yet)
......
@_LOWER:Partition_Name_@_simu/simulator.adb
simulation/simulator.adb
......@@ -3,3 +3,21 @@
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_node.ascii
@@TABLE@@
@@IF@@ @_Block_Languages_@ = Ada or @_Block_Languages_@ = SDL
with @_Block_Names_@;
@@END_IF@@
@@END_TABLE@@
package body Simulator_Interface is
procedure Simulation_Startup is
begin
@@TABLE@@
@@IF@@ @_Block_Languages_@ = Ada or @_Block_Languages_@ = SDL
@_Block_Names_@.Startup;
@@END_IF@@
@@END_TABLE@@
end Simulation_Startup;
end Simulator_Interface;
......@@ -6,8 +6,16 @@
with Text_IO; use Text_IO;
package body Simulator is
procedure Simulation_Event (Event : asn1SccEvents) is
procedure Simulation_Event (Event : asn1SccEvent) is
begin
Put_Line ("Event!");
if Events.Length < asn1SccEvents_Length_Index(max_events)
then
Put_Line ("Event!");
Events.Length := Events.Length + 1;
Events.Data (Events.Length) := Event;
else
Put_Line ("Event dropped: queue full");
end if;
end Simulation_Event;
end Simulator;
......@@ -3,3 +3,21 @@
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f then Ctrl-W-L (or gf) in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_system.ascii
@@TABLE@@
@@IF@@ @_Block_Languages_@ = Ada or @_Block_Languages_@ = SDL
with @_Block_Names_@;
@@END_IF@@
@@END_TABLE@@
package body Simulator_Interface is
procedure Simulation_Startup is
begin
@@TABLE@@
@@IF@@ @_Block_Languages_@ = Ada or @_Block_Languages_@ = SDL
@_Block_Names_@.Startup;
@@END_IF@@
@@END_TABLE@@
end Simulation_Startup;
end Simulator_Interface;
@_LOWER:Partition_Name_@_simu/simulator.ads
simulation/simulator.ads
......@@ -3,3 +3,8 @@
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_node.ascii
with Simulator;
package Simulator_Interface is
procedure Simulation_Startup;
end Simulator_Interface;
......@@ -3,8 +3,13 @@
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_partition.ascii
with Ada.Containers.Indefinite_Hashed_Maps;
with Simulation_Dataview; use Simulation_Dataview;
with adaasn1rtl;
package Simulator is
procedure Simulation_Event (Event : asn1SccEvents);
Events : asn1SccEvents := asn1SccEvents_Init;
procedure Simulation_Event (Event : asn1SccEvent);
-- procedure Simulation_Startup;
end Simulator;
......@@ -3,3 +3,9 @@
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f then Ctrl-W-L (or gf) in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_system.ascii
with Simulator;
package Simulator_Interface is
procedure Simulation_Startup;
end Simulator_Interface;
......@@ -21,7 +21,7 @@ BEGIN
@_Nodes'Indent_@
Events ::= CHOICE {
Event ::= CHOICE {
@@INLINE( )(,\n )()@@
@@TABLE'ALIGN_ON(" ")@@
@_LOWER:REPLACE_ALL(_/-):Block_Names_@ @_REPLACE_ALL(_/-):CAPITALIZE:Block_Names_@-Event
......@@ -29,8 +29,13 @@ BEGIN
@@END_INLINE@@
}
-- Define a queue of events
max-events INTEGER ::= 10
Events ::= SEQUENCE (SIZE (0 .. max-events)) OF Event
-- Global system state
System-State ::= SEQUENCE {
events Events,
@@INLINE( )(,\n )()@@
@@TABLE'ALIGN_ON(" ")@@
@@IF@@ @_Block_Languages_@ = SDL
......
......@@ -10,4 +10,3 @@
@@TABLE'ALIGN_ON(" ")@@
@_Param_Types_@ FROM @_REPLACE_ALL(_/-):Param_ASN1_Modules_@
@@END_TABLE@@
......@@ -12,11 +12,12 @@ library project @_CAPITALIZE:Name_@_Simulator is
for Library_Standalone use "encapsulated";
for Library_Options use ("-lrt", "-lm");
for Interfaces use
("@_LOWER:Name_@_simulator_interface.h",
"simulation_dataview.ads",
("simulation_dataview.ads",
"board_config.ads",
"simulator.ads",
"simulator_interface.ads",
"taste_basictypes.ads",
"adaasn1rtl-encoding.ads",
@_Threads'Indent_@
"adaasn1rtl.ads");
......@@ -47,7 +48,7 @@ library project @_CAPITALIZE:Name_@_Simulator is
"../../@_LOWER:Block_Instance_Of_@/@_Block_Languages_@/src",
@@END_IF@@
@@END_TABLE@@
"@_LOWER:Name_@_simu")
"simulation")
& external_as_list("EXTERNAL_SOURCE_PATH", ":")
& external_as_list("@_UPPER:Name_@_EXTERNAL_SOURCE_PATH", ":")
& external_as_list("ADA_INCLUDE_PATH", ":");
......
......@@ -21,7 +21,7 @@ procedure @_CAPITALIZE:Name_@ is
@@END_IF@@
@@IF@@ @_Target_@ = SIMU
@@IF@@ @_Kind_@ = SPORADIC_OPERATION
Event : asn1SccEvents (Kind => @_Parent_Function_@_PRESENT);
Event : asn1SccEvent (Kind => @_Parent_Function_@_PRESENT);
begin
Event.@_CAPITALIZE:Parent_Function_@ :=
(Kind => msg_out_PRESENT,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment