Commit 596d7f33 authored by hugues.jerome's avatar hugues.jerome Committed by yoogx
Browse files

* Add a dummy implementation for the FPGA device


git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-ada@865 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent de7c0164
......@@ -28,7 +28,8 @@ if HAS_GNATMAKE_FOR_LEON
$(srcdir)/scenario_uart_2.aadl \
$(srcdir)/scenario_uart_native.aadl \
$(srcdir)/scenario_no_cnx_leon.aadl \
$(srcdir)/scenario_no_cnx_native.aadl
$(srcdir)/scenario_no_cnx_native.aadl \
$(srcdir)/scenario_fpga.aadl
endif
# Note: we may not package $(srcdir)/scenario_uart_2.aadl because some
......
with PolyORB_HI.Output;
-- This package provides support for the GR_RASTA_FPGA device driver
-- as defined in the GR_RASTA_FPGA AADLv2 model.
package body GR_RASTA_FPGA is
use PolyORB_HI.Utils;
use PolyORB_HI.Output;
----------------
-- Initialize --
----------------
procedure Initialize (Name_Table : PolyORB_HI.Utils.Naming_Table_Type) is
pragma Unreferenced (Name_Table);
begin
Put_Line (Normal, "Initialization of SpaceWire subsystem"
& " is complete");
end Initialize;
-------------
-- Receive --
-------------
procedure Receive is
begin
null;
end Receive;
----------
-- Send --
----------
function Send
(Node : Node_Type;
Message : Stream_Element_Array;
Size : Stream_Element_Offset)
return Error_Kind
is
pragma Unreferenced (Node);
begin
Put_Line ("Using user-provided FPGA stack to send");
Put_Line ("Sending" & Stream_Element_Offset'Image (Size)
& " bytes");
Dump (Message (Message'First .. Message'First + Size - 1), Normal);
return Error_Kind'(Error_None);
-- Note: we have no way to no there was an error here
end Send;
end GR_RASTA_FPGA;
with PolyORB_HI.Errors;
with PolyORB_HI_Generated.Deployment;
with PolyORB_HI.Streams;
with PolyORB_HI.Utils;
package GR_RASTA_FPGA is
use PolyORB_HI.Errors;
use PolyORB_HI_Generated.Deployment;
use PolyORB_HI.Streams;
procedure Initialize (Name_Table : PolyORB_HI.Utils.Naming_Table_Type);
procedure Receive;
pragma Warnings (Off);
function Send
(Node : Node_Type;
Message : Stream_Element_Array;
Size : Stream_Element_Offset)
return Error_Kind;
pragma Export (C, Send, "gr_rasta_fpga_device.impl_send");
pragma Warnings (On);
end GR_RASTA_FPGA;
package GR_RASTA_FPGA
-- This package models a SpaceWire-based protocol layer for the
-- PolyORB-HI/Ada AADL runtime, based on the XXX. It defines the
-- subprograms and threads to be integrated with the runtime low level
-- interface.
public
with GR_CPCI_X4CV;
with Generic_Bus;
------------
-- DEVICE --
------------
-- The main entrypoint for this package is this device, it relies
-- on the 'Implement_As' feature that defines its full
-- specification.
device GR_RASTA_FPGA_Device
features
CPCI_Slot : requires bus access Generic_Bus::Generic_Bus.impl;
-- Connection to the remote node
end GR_RASTA_FPGA_Device;
device implementation GR_RASTA_FPGA_Device.impl
properties
Implemented_As =>
classifier (GR_RASTA_FPGA::Driver_GR_RASTA_FPGA.impl);
Initialize_Entrypoint => classifier (GR_RASTA_FPGA::Initialize);
end GR_RASTA_FPGA_Device.impl;
------------
-- DRIVER --
------------
-- In AADLv2, we can model the actual implementation of a driver
-- using an abstract component.
abstract Driver_GR_RASTA_FPGA
end Driver_GR_RASTA_FPGA;
abstract implementation Driver_GR_RASTA_FPGA.impl
subcomponents
receiver : thread Driver_GR_RASTA_FPGA_thread_receiver.impl;
end Driver_GR_RASTA_FPGA.impl;
-------------
-- THREADS --
-------------
-- This thread handles the execution logic of the protocol
-- stack. It relies on the previous subprograms to receive
-- messages.
thread Driver_GR_RASTA_FPGA_thread_receiver
-- This thread is dispatched when an event is detected on the
-- real hardware. It then calls receive to handle the incoming
-- event.
properties
Dispatch_Protocol => Background;
Priority => 12;
end Driver_GR_RASTA_FPGA_thread_receiver;
thread implementation Driver_GR_RASTA_FPGA_thread_receiver.impl
calls
call1 : { pspg : subprogram receive; };
end Driver_GR_RASTA_FPGA_thread_receiver.impl;
-----------------
-- SUBPROGRAMS --
-----------------
-- These subprograms model the high-level view of the SpaceWire
-- protocol stack. They define an API used by the stack to send and
-- receive data, and perform node's initialisation.
subprogram Initialize
-- Initialize the different internal resources for managing
-- connections on a node. This subprogram has no formal visible
-- parameters, but relies on well-known data structures and
-- variables to configure the stack.
properties
Source_Name => "GR_RASTA_FPGA.Initialize";
Source_Language => Ada;
end Initialize;
-------------
subprogram Receive
-- Receive data and dispatch them to the receiving entity. This
-- program and its sibling (send) share a common protocol, not
-- defined in the AADL model.
properties
Source_Name => "GR_RASTA_FPGA.Receive";
Source_Language => Ada;
end Receive;
-------------
subprogram Send
-- Send data to a remote node. This program and its sibling
-- (receive) share a common protocol, not defined in the AADL
-- model.
properties
Source_Name => "GR_RASTA_FPGA.Send";
Source_Language => Ada;
end Send;
end GR_RASTA_FPGA;
......@@ -6,6 +6,7 @@ system scenario
properties
Ocarina_Config::AADL_Files => ("grspw.aadl", "gr_cpci_x4cv.aadl",
"generic_bus.aadl", "native_uart.aadl", "generic_native.aadl",
"grrastafpga.aadl",
"gruart.aadl", "software.aadl", "system_demo.aadl");
Ocarina_Config::Generator => polyorb_hi_ada;
Ocarina_Config::Needed_Property_Sets =>
......
-- This is a scenario file describing the devide driver integration demo
-- $Id: scenario_local.aadl 6713 2009-06-20 20:58:28Z lanarre $
system delayed_connections
properties
Ocarina_Config::AADL_Files => ("grspw.aadl", "gr_cpci_x4cv.aadl",
"generic_bus.aadl", "native_uart.aadl", "generic_native.aadl",
"grrastafpga.aadl",
"gruart.aadl", "software.aadl", "system_demo.aadl");
Ocarina_Config::Generator => polyorb_hi_ada;
Ocarina_Config::Needed_Property_Sets =>
(value (Ocarina_Config::Data_Model),
value (Ocarina_Config::Deployment));
Ocarina_Config::AADL_Version => AADLv2;
Ocarina_Config::Root_System_Name => "the_demo.rasta_fpga";
end delayed_connections;
system implementation delayed_connections.Impl
end delayed_connections.Impl;
......@@ -6,6 +6,7 @@ system delayed_connections
properties
Ocarina_Config::AADL_Files => ("grspw.aadl", "gr_cpci_x4cv.aadl",
"generic_bus.aadl", "native_uart.aadl", "generic_native.aadl",
"grrastafpga.aadl",
"gruart.aadl", "software.aadl", "system_demo.aadl");
Ocarina_Config::Generator => polyorb_hi_ada;
Ocarina_Config::Needed_Property_Sets =>
......
......@@ -6,6 +6,7 @@ system delayed_connections
properties
Ocarina_Config::AADL_Files => ("grspw.aadl", "gr_cpci_x4cv.aadl",
"generic_bus.aadl", "native_uart.aadl", "generic_native.aadl",
"grrastafpga.aadl",
"gruart.aadl", "software.aadl", "system_demo.aadl");
Ocarina_Config::Generator => polyorb_hi_ada;
Ocarina_Config::Needed_Property_Sets =>
......
......@@ -6,7 +6,8 @@ system delayed_connections
properties
Ocarina_Config::AADL_Files => ("grspw.aadl", "gr_cpci_x4cv.aadl",
"generic_bus.aadl", "native_uart.aadl", "generic_native.aadl",
"gruart.aadl", "software.aadl", "system_demo.aadl");
"grrastafpga.aadl",
"gruart.aadl", "software.aadl", "system_demo.aadl");
Ocarina_Config::Generator => polyorb_hi_ada;
Ocarina_Config::Needed_Property_Sets =>
(value (Ocarina_Config::Data_Model),
......
......@@ -6,6 +6,7 @@ system delayed_connections
properties
Ocarina_Config::AADL_Files => ("grspw.aadl", "gr_cpci_x4cv.aadl",
"generic_bus.aadl", "native_uart.aadl", "generic_native.aadl",
"grrastafpga.aadl",
"gruart.aadl", "software.aadl", "system_demo.aadl");
Ocarina_Config::Generator => polyorb_hi_ada;
Ocarina_Config::Needed_Property_Sets =>
......
......@@ -6,6 +6,7 @@ system delayed_connections
properties
Ocarina_Config::AADL_Files => ("grspw.aadl", "gr_cpci_x4cv.aadl",
"gruart.aadl", "software.aadl", "system_demo.aadl",
"grrastafpga.aadl",
"generic_bus.aadl",
"generic_native.aadl", "native_uart.aadl");
Ocarina_Config::Generator => polyorb_hi_ada;
......
......@@ -6,6 +6,7 @@ system delayed_connections
properties
Ocarina_Config::AADL_Files => ("grspw.aadl", "gr_cpci_x4cv.aadl",
"generic_bus.aadl", "native_uart.aadl", "generic_native.aadl",
"grrastafpga.aadl",
"gruart.aadl", "software.aadl", "system_demo.aadl");
Ocarina_Config::Generator => polyorb_hi_ada;
Ocarina_Config::Needed_Property_Sets =>
......
......@@ -11,7 +11,7 @@ public
with GR_CPCI_X4CV; -- GR_CPCI_X4CV board
with GRSPW_Protocol; -- SpaceWire protocol stack, as an AADL device
with GRUART_Protocol; -- GRUART protocol stack, as an AADL device
with GR_RASTA_FPGA;
with Generic_Native;
with Native_UART_Protocol;
......@@ -341,6 +341,8 @@ public
end The_Demo.No_Cnx_LEON;
---------------------------------------------------------------------------
system implementation The_Demo.No_Cnx_Native
-- Note: this setting assumes one node, without particular
......@@ -362,4 +364,46 @@ public
end The_Demo.No_Cnx_Native;
---------------------------------------------------------------------------
system implementation The_Demo.RASTA_FPGA
-- Note: this setting assumes one RASTA board, with RASTA_FPGA DSU #1
-- connected to RASTA_FPGA DSU #2.
--
-- It shows operation of the GRRASTA_FPGA driver.
subcomponents
Bus_RASTA_FPGA : bus Generic_Bus::Generic_Bus.impl;
-- Node #1 hardware components
Processor_1 : processor GR_CPCI_X4CV::LEON2.impl;
Memory_1 : memory GR_CPCI_X4CV::Memory_Segment.impl;
GR_RASTA_FPGA_Cnx_1 : device GR_RASTA_FPGA::GR_RASTA_FPGA_Device.impl
{ Deployment::Location => "XXX";
-- Dummy configuration
};
-- Node #1 software components
Node_1 : process Process_Simple.Impl;
connections
bus access Bus_RASTA_FPGA -> GR_RASTA_FPGA_Cnx_1.CPCI_Slot;
port Node_1.Out_Port -> Node_1.In_Port
{ Actual_Connection_Binding => (reference (Bus_RASTA_FPGA)); };
properties
Actual_Processor_Binding => (reference (Processor_1)) applies to Node_1;
Actual_Processor_Binding => (reference (Processor_1))
applies to GR_RASTA_FPGA_Cnx_1;
end The_Demo.RASTA_FPGA;
end System_Demo;
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