From 6d897ec95e89982f6449c083353b8af73c2c0479 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 12 Nov 2019 18:41:26 +0100 Subject: netlists-memories: do not crash on anonymous ROM. --- src/synth/netlists-memories.adb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/synth/netlists-memories.adb b/src/synth/netlists-memories.adb index d41468f86..9098cbfb1 100644 --- a/src/synth/netlists-memories.adb +++ b/src/synth/netlists-memories.adb @@ -723,9 +723,12 @@ package body Netlists.Memories is when Id_Const_Bit => Check_Memory_Read_Ports (Inst, Data_W, Size); if Data_W /= 0 then - Info_Msg_Synth - (+Inst, "found ROM %n, width: %v bits, depth: %v", - (1 => +Inst, 2 => +Data_W, 3 => +Size)); + if Get_Location (Inst) /= No_Location then + -- Not all Const_Bit have a location... + Info_Msg_Synth + (+Inst, "found ROM %n, width: %v bits, depth: %v", + (1 => +Inst, 2 => +Data_W, 3 => +Size)); + end if; Replace_ROM_Memory (Ctxt, Inst); end if; when others => -- cgit v1.2.3