OpenAADL / ocarina

AADL model processor: mappings to code (C, Ada); Petri Nets; scheduling tools (MAST, Cheddar); WCET; REAL
http://www.openaadl.org
Other
66 stars 29 forks source link

Assertion Failure #26

Closed laukokhao closed 9 years ago

laukokhao commented 9 years ago

Hi

With POK, I ran the makefile:

BUILD = --models=pololu_motor.aadl --no-run TESTS = compile-x86 compile-ppc compile-sparc

include $(POK_PATH)/misc/mk/examples.mk

and received this error:

Will execute ocarina -aadlv2 -f -g pok_c pololu_motor.aadl $POK_PATH/misc/aadl-library.aadl +========================== OCARINA BUG DETECTED =========================+ | Detected exception: SYSTEM.ASSERTIONS.ASSERT_FAILURE | | Error: ocarina-me_aadl-aadl_instances-nodes.adb:183 | | Please refer to the User's Guide for more details. | +=========================================================================+

Exception name: SYSTEM.ASSERTIONS.ASSERT_FAILURE Message: ocarina-me_aadl-aadl_instances-nodes.adb:183

Code generation failed make: *\ [build] Error 1

This is my AADL model:

package pololu_motor public

with Deployment, Data_Model, POK;


-- System --

system motor_system end motor_system;

system implementation motor_system.impl subcomponents Control : process ctr.impl; CPU1 : processor cpu.impl; Mem1 : memory motor_memory.impl; Motor : device mtr.impl; USB : bus universal_serial_bus.impl; connections BC1 : bus access USB -> CPU1.BA1; BC2 : bus access USB -> Mem1.BA2; BC3 : bus access USB -> Motor.BA3; Rotate_Conn : port Control.send_rotation -> Motor.rec_rotation; properties Actual_Processor_Binding => (reference (CPU1)) applies to Control; Actual_Memory_Binding => (reference (Mem1)) applies to Control; Actual_Connection_Binding => (reference (USB)) applies to Rotate_Conn; end motor_system.impl;


--- Memory- ---

memory motor_memory features BA2 : requires bus access universal_serial_bus.impl; end motor_memory;

memory implementation motor_memory.impl end motor_memory.impl;


--- Devices ---

device mtr features BA3 : requires bus access universal_serial_bus.impl; rec_rotation : in event data port dummy; end mtr;

device implementation mtr.impl end mtr.impl;


---- Buses ----

bus universal_serial_bus end universal_serial_bus;

bus implementation universal_serial_bus.impl properties Deployment::Transport_API => BSD_Sockets; end universal_serial_bus.impl;


-- Processor --

processor cpu features BA1 : requires bus access universal_serial_bus.impl; properties --Deployment::Execution_Platform => LINUX64; POK::Architecture => x86; POK::BSP => x86_qemu; end cpu;

processor implementation cpu.impl subcomponents partition : virtual processor mypartition.impl; properties --Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); --Priority_Range => 1 .. 2; POK::Major_Frame => 1000 ms; POK::Scheduler => STATIC; POK::Slots => (1000 ms); POK::Slots_Allocation => (reference (partition)); end cpu.impl;


---Virtual Processor---

virtual processor mypartition properties POK::Scheduler => RR; end mypartition;

virtual processor implementation mypartition.impl end mypartition.impl;


-- Processes --

process ctr features send_rotation : out event data port dummy; properties POK::Needed_Memory_Size => 120 KByte; end ctr;

process implementation ctr.impl subcomponents activity : thread task.impl; connections Rot_Conn: port activity.rotate_out -> send_rotation; end ctr.impl;


-- Threads --

thread task features rotate_out : out event data port dummy; end task;

thread implementation task.impl calls Mycalls: { hello_code : subprogram Hello_Spg; };
connections Param_Conn : parameter hello_code.Param1 -> rotate_out; properties Dispatch_Protocol => Periodic; Period => 1000 ms; Recover_Execution_time => 10 ms .. 20 ms; Deadline => 1000 ms; Priority => 1; end task.impl;


----- Data ------

data dummy properties Data_Model::Data_Representation => Float; end dummy;


-- Subprograms --

subprogram Hello_Spg features Param1 : out parameter dummy; properties Source_Language => (C); Source_Name => "simple"; POK::Source_Location => "../../../simple.o"; end Hello_Spg;

end pololu_motor;

Regards, Peter

yoogx commented 9 years ago

This issue is now solved, Ocarina returns an error message to indicate that a device is not bound to a processor.