From 6b81ec185f16791362ca770f391578c2a8b828f0 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 25 Jan 2021 18:18:30 +0100 Subject: std_names: add gclk. For #1610 Regenerate python files. --- src/std_names.adb | 1 + src/std_names.ads | 3 ++- src/synth/ghdlsynth.h | 7 +++++++ src/synth/netlists.ads | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/std_names.adb b/src/std_names.adb index 26eb53b84..4def79432 100644 --- a/src/std_names.adb +++ b/src/std_names.adb @@ -682,6 +682,7 @@ package body Std_Names is Def ("allseq", Name_Allseq); Def ("anyconst", Name_Anyconst); Def ("anyseq", Name_Anyseq); + Def ("gclk", Name_Gclk); -- Verilog directives Def ("define", Name_Define); diff --git a/src/std_names.ads b/src/std_names.ads index 36fdbf249..2a7fc8dc0 100644 --- a/src/std_names.ads +++ b/src/std_names.ads @@ -767,7 +767,8 @@ package Std_Names is Name_Allseq : constant Name_Id := Name_First_Synthesis + 001; Name_Anyconst : constant Name_Id := Name_First_Synthesis + 002; Name_Anyseq : constant Name_Id := Name_First_Synthesis + 003; - Name_Last_Synthesis : constant Name_Id := Name_Anyseq; + Name_Gclk : constant Name_Id := Name_First_Synthesis + 004; + Name_Last_Synthesis : constant Name_Id := Name_Gclk; -- Verilog Directives. Name_First_Directive : constant Name_Id := Name_Last_Synthesis + 1; diff --git a/src/synth/ghdlsynth.h b/src/synth/ghdlsynth.h index 90c4f15f0..abbb68f77 100644 --- a/src/synth/ghdlsynth.h +++ b/src/synth/ghdlsynth.h @@ -72,6 +72,13 @@ namespace GhdlSynth { return name_table__get_address (n.id); } + extern "C" unsigned name_table__get_identifier_with_len(const char *s, unsigned l); + inline Name_Id get_identifier(const char *s) { + Name_Id n; + n.id = name_table__get_identifier_with_len(s, strlen(s)); + return n; + } + struct Sname { unsigned int id; }; const Sname No_Sname = {0 }; diff --git a/src/synth/netlists.ads b/src/synth/netlists.ads index 5ef74a77d..93bf8b1d3 100644 --- a/src/synth/netlists.ads +++ b/src/synth/netlists.ads @@ -397,6 +397,8 @@ private function Attribute_Build (Params : Instance) return Instance; function Attribute_Build_Value (Obj : Instance) return Attribute; + -- Per instance map of attribute. + -- The index is the sub-instance, the value is the attribute chain. package Attribute_Maps is new Dyn_Maps (Params_Type => Instance, Object_Type => Instance, -- cgit v1.2.3