diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-10-01 20:27:27 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-10-01 20:27:27 +0200 |
commit | c3bd820b4b43cc12672091e3c90a59554c050c50 (patch) | |
tree | 772e7e82fa11da9e23ffbdd8c0645b2f3f3de1dd /src/synth/synth-insts.adb | |
parent | 08b709a5419c49bca150db52a93167f4a1685f26 (diff) | |
download | ghdl-c3bd820b4b43cc12672091e3c90a59554c050c50.tar.gz ghdl-c3bd820b4b43cc12672091e3c90a59554c050c50.tar.bz2 ghdl-c3bd820b4b43cc12672091e3c90a59554c050c50.zip |
synth: handle string subtype defined by a port. Fix #958
Diffstat (limited to 'src/synth/synth-insts.adb')
-rw-r--r-- | src/synth/synth-insts.adb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/synth/synth-insts.adb b/src/synth/synth-insts.adb index 841cf75e2..4a1485ef3 100644 --- a/src/synth/synth-insts.adb +++ b/src/synth/synth-insts.adb @@ -259,6 +259,7 @@ package body Synth.Insts is O : Value_Acc; Nbr_Inputs : Port_Nbr; Nbr_Outputs : Port_Nbr; + Formal_Typ : Type_Acc; begin Assoc := Ports_Assoc; Assoc_Inter := Get_Port_Chain (Inst_Obj.Decl); @@ -276,11 +277,13 @@ package body Synth.Insts is raise Internal_Error; end case; + Formal_Typ := Get_Value_Type (Inst_Obj.Syn_Inst, Get_Type (Inter)); case Mode_To_Port_Kind (Get_Mode (Inter)) is when Port_In => -- Connect the net to the input. Connect (Get_Input (Inst, Nbr_Inputs), - Get_Net (Synth_Expression (Syn_Inst, Actual))); + Get_Net (Synth_Expression_With_Type + (Syn_Inst, Actual, Formal_Typ))); Nbr_Inputs := Nbr_Inputs + 1; when Port_Out | Port_Inout => @@ -288,9 +291,7 @@ package body Synth.Insts is -- Create a port gate (so that is has a name). Port := Get_Output (Inst, Nbr_Outputs); Port := Builders.Build_Port (Get_Build (Syn_Inst), Port); - O := Create_Value_Net - (Port, Get_Value_Type (Inst_Obj.Syn_Inst, - Get_Type (Inter))); + O := Create_Value_Net (Port, Formal_Typ); -- Assign the port output to the actual (a net). Synth_Assignment (Syn_Inst, Actual, O, Assoc); end if; |