Skip to content

Commit

Permalink
* Always generate __po_hi_local_port_t, this type is used by VCD
Browse files Browse the repository at this point in the history
    For #244
  • Loading branch information
yoogx committed Mar 1, 2020
1 parent 7dc8e4b commit 3b85ace
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions src/backends/po_hi_c/ocarina-backends-po_hi_c-deployment.adb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2019 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2020 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
Expand Down Expand Up @@ -1381,26 +1381,24 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Global_Port_Model_Names);
end if;

if not Is_Empty (Local_Port_List) then
if not Invalid_Local_Port_Added then
Set_Str_To_Name_Buffer ("invalid_local_port_t");
N :=
Make_Expression
(Make_Defining_Identifier (Name_Find),
Op_Equal,
(Make_Literal (CV.New_Int_Value (1, -1, 10))));
Append_Node_To_List (N, Local_Port_List);

Invalid_Local_Port_Added := True;
end if;

if not Invalid_Local_Port_Added then
Set_Str_To_Name_Buffer ("invalid_local_port_t");
N :=
Make_Full_Type_Declaration
(Defining_Identifier => RE (RE_Local_Port_T),
Type_Definition => Make_Enum_Aggregate (Local_Port_List));
Append_Node_To_List (N, CTN.Declarations (Current_File));
Make_Expression
(Make_Defining_Identifier (Name_Find),
Op_Equal,
(Make_Literal (CV.New_Int_Value (1, -1, 10))));
Append_Node_To_List (N, Local_Port_List);

Invalid_Local_Port_Added := True;
end if;

N :=
Make_Full_Type_Declaration
(Defining_Identifier => RE (RE_Local_Port_T),
Type_Definition => Make_Enum_Aggregate (Local_Port_List));
Append_Node_To_List (N, CTN.Declarations (Current_File));

N :=
Make_Define_Statement
(Defining_Identifier => RE (RE_Nb_Devices),
Expand Down

0 comments on commit 3b85ace

Please sign in to comment.