diff options
| author | gingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7> | 2010-01-28 06:08:48 +0000 | 
|---|---|---|
| committer | gingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7> | 2010-01-28 06:08:48 +0000 | 
| commit | e2b41faa79b1f32569ccbc514a375fc2e6f5e99f (patch) | |
| tree | bdb53cf3c46d99c7dd5d125cb262034e7498cde8 | |
| parent | 3cc13c09aeaaf0920cedd2bf7a8e902735a92d42 (diff) | |
| download | ghdl-e2b41faa79b1f32569ccbc514a375fc2e6f5e99f.tar.gz ghdl-e2b41faa79b1f32569ccbc514a375fc2e6f5e99f.tar.bz2 ghdl-e2b41faa79b1f32569ccbc514a375fc2e6f5e99f.zip | |
Improve doc.
Remove ortho_code-sysdeps.
Add Pragma convention C in grt for accesses to subprograms.
Fix build on windows.
| -rw-r--r-- | doc/ghdl.texi | 7 | ||||
| -rw-r--r-- | ortho/mcode/ortho_code-consts.adb | 15 | ||||
| -rw-r--r-- | ortho/mcode/ortho_code-sysdeps.adb | 6 | ||||
| -rw-r--r-- | ortho/mcode/ortho_code-sysdeps.ads | 4 | ||||
| -rw-r--r-- | ortho/mcode/ortho_code-types.adb | 6 | ||||
| -rw-r--r-- | ortho/mcode/ortho_mcode.adb | 2 | ||||
| -rw-r--r-- | sem_assocs.adb | 2 | ||||
| -rw-r--r-- | translate/grt/grt-processes.ads | 1 | ||||
| -rw-r--r-- | translate/grt/grt-signals.adb | 1 | ||||
| -rw-r--r-- | translate/grt/grt-signals.ads | 3 | ||||
| -rw-r--r-- | translate/grt/grt-vpi.ads | 1 | ||||
| -rw-r--r-- | translate/mcode/winbuild.bat | 2 | ||||
| -rw-r--r-- | translate/mcode/windows/compile.bat | 4 | ||||
| -rw-r--r-- | translate/mcode/windows/ghdl.nsi | 2 | ||||
| -rw-r--r-- | translate/mcode/windows/ortho_code-sysdeps.adb | 8 | ||||
| -rw-r--r-- | translate/mcode/windows/ortho_code-x86-flags.ads | 2 | 
16 files changed, 35 insertions, 31 deletions
| diff --git a/doc/ghdl.texi b/doc/ghdl.texi index eed41f110..ea44ebb98 100644 --- a/doc/ghdl.texi +++ b/doc/ghdl.texi @@ -1931,7 +1931,8 @@ completely analyzed using either the 87 or the 93 version of the VHDL standard.  @node PSL implementation, Source representation, VHDL standards, GHDL implementation of VHDL  @comment  node-name,  next,  previous,  up  @section PSL implementation -GHDL understands embedded PSL annotations in VHDL files, but in separate files. +GHDL understands embedded PSL annotations in VHDL files, but not in +separate files.  As PSL annotations are embedded within comments, you must analyze and elaborate  your design with option @option{-fpsl} to enable PSL annotations. @@ -1941,8 +1942,8 @@ with the @code{psl} keyword.  The keyword must be followed (on the  same line) by a PSL keyword such as @code{assert} or @code{default}.  To continue a PSL statement on the next line, just start a new comment. -A PSL statement is considered as a concurrent statement, and therefore is -allowed only where processes are. +A PSL statement is considered as a process.  So it is not allowed within +a process.  All PSL assertions must be clocked (GHDL doesn't support unclocked assertion).  Furthermore only one clock per assertion is allowed. diff --git a/ortho/mcode/ortho_code-consts.adb b/ortho/mcode/ortho_code-consts.adb index dcd7d28cc..affe82c8d 100644 --- a/ortho/mcode/ortho_code-consts.adb +++ b/ortho/mcode/ortho_code-consts.adb @@ -26,43 +26,52 @@ package body Ortho_Code.Consts is        Kind : OC_Kind;        Lit_Type : O_Tnode;     end record; +   for Cnode_Common'Size use 64;     type Cnode_Signed is record        Val : Integer_64;     end record; +   for Cnode_Signed'Size use 64;     type Cnode_Unsigned is record        Val : Unsigned_64;     end record; +   for Cnode_Unsigned'Size use 64;     type Cnode_Float is record        Val : IEEE_Float_64;     end record; +   for Cnode_Float'Size use 64;     type Cnode_Enum is record        Id : O_Ident;        Val : Uns32;     end record; +   for Cnode_Enum'Size use 64;     type Cnode_Addr is record        Decl : O_Dnode;        Pad : Int32;     end record; +   for Cnode_Addr'Size use 64;     type Cnode_Aggr is record        Els : Int32;        Nbr : Int32;     end record; +   for Cnode_Aggr'Size use 64;     type Cnode_Sizeof is record        Atype : O_Tnode;        Pad : Int32;     end record; +   for Cnode_Sizeof'Size use 64;     type Cnode_Union is record        El : O_Cnode;        Field : O_Fnode;     end record; +   for Cnode_Union'Size use 64;     package Cnodes is new GNAT.Table       (Table_Component_Type => Cnode_Common, @@ -86,7 +95,7 @@ package body Ortho_Code.Consts is        function To_Cnode_Unsigned is new Ada.Unchecked_Conversion          (Cnode_Common, Cnode_Unsigned);     begin -      return To_Cnode_Unsigned (Cnodes.Table (Cst  + 1)).Val; +      return To_Cnode_Unsigned (Cnodes.Table (Cst + 1)).Val;     end Get_Const_U64;     function Get_Const_I64 (Cst : O_Cnode) return Integer_64 @@ -94,7 +103,7 @@ package body Ortho_Code.Consts is        function To_Cnode_Signed is new Ada.Unchecked_Conversion          (Cnode_Common, Cnode_Signed);     begin -      return To_Cnode_Signed (Cnodes.Table (Cst  + 1)).Val; +      return To_Cnode_Signed (Cnodes.Table (Cst + 1)).Val;     end Get_Const_I64;     function Get_Const_F64 (Cst : O_Cnode) return IEEE_Float_64 @@ -102,7 +111,7 @@ package body Ortho_Code.Consts is        function To_Cnode_Float is new Ada.Unchecked_Conversion          (Cnode_Common, Cnode_Float);     begin -      return To_Cnode_Float (Cnodes.Table (Cst  + 1)).Val; +      return To_Cnode_Float (Cnodes.Table (Cst + 1)).Val;     end Get_Const_F64;     function To_Cnode_Common is new Ada.Unchecked_Conversion diff --git a/ortho/mcode/ortho_code-sysdeps.adb b/ortho/mcode/ortho_code-sysdeps.adb deleted file mode 100644 index c5e062938..000000000 --- a/ortho/mcode/ortho_code-sysdeps.adb +++ /dev/null @@ -1,6 +0,0 @@ -package body Ortho_Code.Sysdeps is -   procedure Init is -   begin -      null; -   end Init; -end Ortho_Code.Sysdeps; diff --git a/ortho/mcode/ortho_code-sysdeps.ads b/ortho/mcode/ortho_code-sysdeps.ads deleted file mode 100644 index e680e4d71..000000000 --- a/ortho/mcode/ortho_code-sysdeps.ads +++ /dev/null @@ -1,4 +0,0 @@ -package Ortho_Code.Sysdeps is -   --  OS dependant initializations. -   procedure Init; -end Ortho_Code.Sysdeps; diff --git a/ortho/mcode/ortho_code-types.adb b/ortho/mcode/ortho_code-types.adb index 63e677033..1a505b750 100644 --- a/ortho/mcode/ortho_code-types.adb +++ b/ortho/mcode/ortho_code-types.adb @@ -722,6 +722,12 @@ package body Ortho_Code.Types is              Put (", nbr_fields: ");              Put (To_Int32 (Get_Type_Record_Nbr_Fields (Atype)));              New_Line; +         when OT_Subarray => +            Put ("  base type: "); +            Put (Int32 (Get_Type_Subarray_Base (Atype))); +            Put (", length: "); +            Put (To_Int32 (Get_Type_Subarray_Length (Atype))); +            New_Line;           when others =>              null;        end case; diff --git a/ortho/mcode/ortho_mcode.adb b/ortho/mcode/ortho_mcode.adb index f9335fac1..722e884a7 100644 --- a/ortho/mcode/ortho_mcode.adb +++ b/ortho/mcode/ortho_mcode.adb @@ -17,7 +17,6 @@  --  02111-1307, USA.  with Ada.Text_IO;  with Ortho_Code.Debug; -with Ortho_Code.Sysdeps;  with Ortho_Ident;  -- with Binary_File; @@ -80,7 +79,6 @@ package body Ortho_Mcode is        if New_Access_Type (O_Tnode_Null) /= O_Tnode_Ptr then           raise Program_Error;        end if; -      Ortho_Code.Sysdeps.Init;        --  Do not finish the access, since this creates an infinite recursion        --  in gdb (at least for GDB 6.3).        --Finish_Access_Type (O_Tnode_Ptr, O_Tnode_Ptr); diff --git a/sem_assocs.adb b/sem_assocs.adb index 820f50d28..b3fc42c6d 100644 --- a/sem_assocs.adb +++ b/sem_assocs.adb @@ -467,6 +467,7 @@ package body Sem_Assocs is        Sub : Iir;        Formal_Object : Iir;     begin +      --  Recurse.        Formal_Object := Name_To_Object (Formal);        case Get_Kind (Formal_Object) is           when Iir_Kind_Indexed_Name @@ -518,6 +519,7 @@ package body Sem_Assocs is        end case;     end Add_Individual_Association_1; +   --  Insert ASSOC into the tree of individual assoc rooted by IASSOC.     procedure Add_Individual_Association (Iassoc : Iir; Assoc : Iir)     is        Formal : Iir; diff --git a/translate/grt/grt-processes.ads b/translate/grt/grt-processes.ads index b59a5b131..3218d7286 100644 --- a/translate/grt/grt-processes.ads +++ b/translate/grt/grt-processes.ads @@ -127,6 +127,7 @@ package Grt.Processes is  private     --  Access to a process subprogram.     type Proc_Acc is access procedure (Self : System.Address); +   pragma Convention (C, Proc_Acc);     --  State of a process.     type Process_State is diff --git a/translate/grt/grt-signals.adb b/translate/grt/grt-signals.adb index 8704aab36..fc2407794 100644 --- a/translate/grt/grt-signals.adb +++ b/translate/grt/grt-signals.adb @@ -1804,6 +1804,7 @@ package body Grt.Signals is     end Compute_Resolved_Signal;     type Conversion_Func_Acc is access procedure (Instance : System.Address); +   pragma Convention (C, Conversion_Func_Acc);     function To_Conversion_Func_Acc is new Ada.Unchecked_Conversion       (Source => System.Address, Target => Conversion_Func_Acc); diff --git a/translate/grt/grt-signals.ads b/translate/grt/grt-signals.ads index bab73ce10..79d6e55ec 100644 --- a/translate/grt/grt-signals.ads +++ b/translate/grt/grt-signals.ads @@ -76,7 +76,8 @@ package Grt.Signals is     --  Function access type used to evaluate the guard expression.     type Guard_Func_Acc is access function (This : System.Address) -     return Ghdl_B2; +                                          return Ghdl_B2; +   pragma Convention (C, Guard_Func_Acc);     --  Simply linked list of processes to be resumed in case of events. diff --git a/translate/grt/grt-vpi.ads b/translate/grt/grt-vpi.ads index a7f06f77a..694db8c1a 100644 --- a/translate/grt/grt-vpi.ads +++ b/translate/grt/grt-vpi.ads @@ -137,6 +137,7 @@ package Grt.Vpi is       (Source => Address, Target => p_cb_data);     type cb_rtn_type is access function (Cb : p_cb_data) return Integer; +   pragma Convention (C, cb_rtn_type);     type s_cb_data is record        Reason : Integer; diff --git a/translate/mcode/winbuild.bat b/translate/mcode/winbuild.bat index bbe031d61..8c2826852 100644 --- a/translate/mcode/winbuild.bat +++ b/translate/mcode/winbuild.bat @@ -7,7 +7,7 @@ if errorlevel 1 goto end  gnatmake windows/ghdlversion -o windows/ghdlversion.exe
  windows\ghdlversion < ../../version.ads > windows/version.nsi
 -"f:\Program Files\NSIS\makensis" windows\ghdl.nsi
 +"c:\Program Files\NSIS\makensis" windows\ghdl.nsi
  if errorlevel 1 goto end
  exit /b 0
 diff --git a/translate/mcode/windows/compile.bat b/translate/mcode/windows/compile.bat index be0aaecc4..c668ef0e2 100644 --- a/translate/mcode/windows/compile.bat +++ b/translate/mcode/windows/compile.bat @@ -8,7 +8,7 @@ gcc -c %CFLAGS% ../../grt/grt-cvpi.c  gcc -c %CFLAGS% ../../grt/config/clock.c
  gcc -c %CFLAGS% ../../../ortho/mcode/memsegs_c.c
  gcc -c %CFLAGS% -DWITH_GNAT_RUN_TIME ../../grt/config/win32.c
 -gnatmake %CFLAGS% -gnatn -aI../windows -aI../../.. -aI../.. -aI../../ghdldrv -aI../../grt -aI../../../ortho/mcode ghdl_mcode -o ghdl.exe -largs grt-cbinding.o clock.o grt-cvpi.o memsegs_c.o win32.o -largs -Wl,--stack,8404992
 +gnatmake %CFLAGS% -gnatn -aI../windows -aI../../.. -aI../.. -aI../../ghdldrv -aI../../../psl -aI../../grt -aI../../../ortho/mcode ghdl_mcode -aI../../../ortho -o ghdl.exe -largs grt-cbinding.o clock.o grt-cvpi.o memsegs_c.o win32.o -largs -Wl,--stack,8404992
  if errorlevel 1 goto failed
 @@ -21,4 +21,4 @@ exit /b 0  echo "Compilation failed"
  cd ..
  exit /b 1
 -
\ No newline at end of file +
 diff --git a/translate/mcode/windows/ghdl.nsi b/translate/mcode/windows/ghdl.nsi index 528a7dfb4..aa4d559aa 100644 --- a/translate/mcode/windows/ghdl.nsi +++ b/translate/mcode/windows/ghdl.nsi @@ -149,7 +149,7 @@ SectionEnd  Section "Documentation (Recommended)"
    SetOutPath $INSTDIR
 -  File ghdl.htm
 +  File /oname=ghdl.htm ..\..\..\doc\ghdl.html
  SectionEnd
  Section "Add in PATH (Recommended)"
 diff --git a/translate/mcode/windows/ortho_code-sysdeps.adb b/translate/mcode/windows/ortho_code-sysdeps.adb deleted file mode 100644 index dbff7b60c..000000000 --- a/translate/mcode/windows/ortho_code-sysdeps.adb +++ /dev/null @@ -1,8 +0,0 @@ -with Ortho_Code.X86.Flags; - -package body Ortho_Code.Sysdeps is -   procedure Init is -   begin -      Ortho_Code.X86.Flags.Flag_Alloca_Call := True; -   end Init; -end Ortho_Code.Sysdeps; diff --git a/translate/mcode/windows/ortho_code-x86-flags.ads b/translate/mcode/windows/ortho_code-x86-flags.ads new file mode 100644 index 000000000..8915f3122 --- /dev/null +++ b/translate/mcode/windows/ortho_code-x86-flags.ads @@ -0,0 +1,2 @@ +with Ortho_Code.X86.Flags_Windows; +package Ortho_Code.X86.Flags renames Ortho_Code.X86.Flags_Windows; | 
