rpms/ghdl/devel ghdl-svn98.patch, NONE, 1.1 ghdl.spec, 1.37, 1.38 ghdl-svn94.patch, 1.1, NONE

Thomas M. Sailer (sailer) fedora-extras-commits at redhat.com
Mon Jun 2 21:59:42 UTC 2008


Author: sailer

Update of /cvs/extras/rpms/ghdl/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18932

Modified Files:
	ghdl.spec 
Added Files:
	ghdl-svn98.patch 
Removed Files:
	ghdl-svn94.patch 
Log Message:
update to svn98, to fix some slice expression bugs


ghdl-svn98.patch:

--- NEW FILE ghdl-svn98.patch ---
diff -urN ghdl-0.26/vhdl/evaluation.adb ghdl-0.26dev/vhdl/evaluation.adb
--- ghdl-0.26/vhdl/evaluation.adb	2007-03-24 08:33:02.000000000 +0100
+++ ghdl-0.26dev/vhdl/evaluation.adb	2008-06-02 23:50:48.000000000 +0200
@@ -2020,6 +2020,10 @@
       --  Should check L <= R or L >= R according to direction.
       --return Eval_Is_In_Bound (Get_Left_Limit (A_Range), Sub_Type)
       --  and then Eval_Is_In_Bound (Get_Right_Limit (A_Range), Sub_Type);
+   exception
+      when Node_Error =>
+         --  Avoid error storms.
+         return True;
    end Eval_Is_Range_In_Bound;
 
    procedure Eval_Check_Range
@@ -2091,6 +2095,8 @@
             return Get_Physical_Value (Expr);
          when Iir_Kind_Unit_Declaration =>
             return Get_Value (Get_Physical_Unit_Value (Expr));
+         when Iir_Kind_Error =>
+            raise Node_Error;
          when others =>
             Error_Kind ("eval_pos", Expr);
       end case;
diff -urN ghdl-0.26/vhdl/grt/config/i386.S ghdl-0.26dev/vhdl/grt/config/i386.S
--- ghdl-0.26/vhdl/grt/config/i386.S	2005-09-23 00:39:19.000000000 +0200
+++ ghdl-0.26dev/vhdl/grt/config/i386.S	2008-06-02 23:50:39.000000000 +0200
@@ -21,21 +21,30 @@
 	
 	.text
 
-	/* Function called to loop on the process.  */	
-	.align 4
-	.type	grt_stack_loop, at function
-grt_stack_loop:	
+#ifdef __ELF__
+#define ENTRY(func) .align 4; .globl func; .type func, at function; func:
+#define END(func) .size func, . - func
+#define NAME(name) name
+#elif __APPLE__
+#define ENTRY(func) .align 4; .globl _##func; _##func:
+#define END(func)
+#define NAME(name) _##name
+#else
+#define ENTRY(func) .align 4; func:
+#define END(func)
+#define NAME(name) name
+#endif
+	
+	/* Function called to loop on the process.  */
+ENTRY(grt_stack_loop)
 	call	*4(%esp)
-	jmp	grt_stack_loop
-	.size	grt_stack_loop, . - grt_stack_loop
+	jmp	NAME(grt_stack_loop)
+END(grt_stack_loop)
 
 	/* function Stack_Create (Func : Address; Arg : Address)
  	                          return Stack_Type;
 	*/
-	.align	4
-	.globl grt_stack_create
-	.type	 grt_stack_create, at function
-grt_stack_create:
+ENTRY(grt_stack_create)
 	/* Standard prologue.  */
 	pushl	%ebp
 	movl	%esp,%ebp
@@ -43,7 +52,7 @@
 	subl	$8,%esp
 	
 	/* Allocate the stack, and exit in case of failure  */
-	call	grt_stack_allocate
+	call	NAME(grt_stack_allocate)
 	testl	%eax,%eax
 	je	.Ldone
 
@@ -58,7 +67,7 @@
 	movl	12(%ebp), %ecx
 	movl	%ecx, -8(%eax)
 	/* The return function.  */
-	movl	$grt_stack_loop, -12(%eax)
+	movl	$NAME(grt_stack_loop), -12(%eax)
 	/* The context.  */
 	movl	%ebx, -16(%eax)
 	movl	%esi, -20(%eax)
@@ -72,16 +81,12 @@
 .Ldone:
 	leave
 	ret
-	.size	 grt_stack_create,. - grt_stack_create
-
+END(grt_stack_create)
 
 
-	.align 4
-	.globl grt_stack_switch
 	/* Arguments:	TO, FROM
 	   Both are pointers to a stack_context.  */
-	.type	 grt_stack_switch, at function
-grt_stack_switch:
+ENTRY(grt_stack_switch)
 	/* TO -> ECX.  */
 	movl	4(%esp), %ecx
 	/* FROM -> EDX.  */
@@ -102,7 +107,7 @@
 	popl	%ebx
 	/* Run.  */
 	ret
-	.size	 grt_stack_switch, . - grt_stack_switch
+END(grt_stack_switch)
 
 	
 	.ident	"Written by T.Gingold"
diff -urN ghdl-0.26/vhdl/grt/config/linux.c ghdl-0.26dev/vhdl/grt/config/linux.c
--- ghdl-0.26/vhdl/grt/config/linux.c	2006-03-09 03:26:31.000000000 +0100
+++ ghdl-0.26dev/vhdl/grt/config/linux.c	2008-06-02 23:50:39.000000000 +0200
@@ -25,6 +25,10 @@
 #include <stdlib.h>
 //#include <stdint.h>
 
+#ifdef __APPLE__
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+
 /* On x86, the stack growns downward.  */
 #define STACK_GROWNS_DOWNWARD 1
 
diff -urN ghdl-0.26/vhdl/grt/config/pthread.c ghdl-0.26dev/vhdl/grt/config/pthread.c
--- ghdl-0.26/vhdl/grt/config/pthread.c	2006-03-10 02:49:44.000000000 +0100
+++ ghdl-0.26dev/vhdl/grt/config/pthread.c	2008-06-02 23:50:39.000000000 +0200
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <setjmp.h>
+#include <assert.h>
 
 //#define INFO printf
 #define INFO (void)
@@ -35,10 +36,14 @@
 // GHDL names an endless loop calling FUNC with ARG a 'stack'
 // at a given time, only one stack may be 'executed'
 typedef struct 
-{	pthread_t           thread;         // stack's thread
-	pthread_mutex_t     mutex;          // mutex to suspend/resume thread
-	void                (*Func)(void*); // stack's FUNC
-	void*               Arg;            // ARG passed to FUNC
+{	
+  pthread_t           thread;         // stack's thread
+  pthread_mutex_t     mutex;          // mutex to suspend/resume thread
+#if defined(__CYGWIN__)
+  pthread_mutexattr_t mxAttr;
+#endif
+  void                (*Func)(void*); // stack's FUNC
+  void*               Arg;            // ARG passed to FUNC
 } Stack_Type_t, *Stack_Type;
 
 static Stack_Type_t      main_stack_context;
@@ -51,40 +56,56 @@
 // This may adjust stack sizes.
 // Must be called after grt.options.decode.
 // => procedure Stack_Init;
-{	INFO("grt_stack_init\n");
-	INFO("  main_stack_context=0x%08x\n", &main_stack_context);
+{
+  int res;
+  INFO("grt_stack_init\n");
+  INFO("  main_stack_context=0x%08x\n", &main_stack_context);
 	
-	pthread_mutex_init(&(main_stack_context.mutex), NULL);
 
-	// lock the mutex, as we are currently running
-	pthread_mutex_lock(&(main_stack_context.mutex));
+#if defined(__CYGWIN__)
+  res = pthread_mutexattr_init (&main_stack_context.mxAttr);
+  assert (res == 0);
+  res = pthread_mutexattr_settype (&main_stack_context.mxAttr,
+				   PTHREAD_MUTEX_DEFAULT);
+  assert (res == 0);
+  res = pthread_mutex_init (&main_stack_context.mutex,
+			    &main_stack_context.mxAttr);
+  assert (res == 0);
+#else
+  res = pthread_mutex_init (&main_stack_context.mutex, NULL);
+  assert (res == 0);
+#endif
+  // lock the mutex, as we are currently running
+  res = pthread_mutex_lock (&main_stack_context.mutex);
+  assert (res == 0);
 	
-	current = &main_stack_context;
+  current = &main_stack_context;
 
-	grt_set_main_stack (&main_stack_context);
+  grt_set_main_stack (&main_stack_context);
 }
 
 //----------------------------------------------------------------------------
 static void* grt_stack_loop(void* pv_myStack)
 {
[...1949 lines suppressed...]
       end if;
       Scan.Scan;
 
+      if Current_Token = Tok_Box then
+         Error_Msg_Parse ("range constraint required");
+         Scan.Scan;
+         return Null_Iir;
+      end if;
+
       return Parse_Range;
    end Parse_Range_Constraint;
 
@@ -407,6 +413,9 @@
          when Tok_Range =>
             --  FIXME: create a subtype indication.
             Rng := Parse_Range_Constraint;
+            if Rng = Null_Iir then
+               return Left;
+            end if;
             Set_Type (Rng, Left);
             return Rng;
          when others =>
diff -urN ghdl-0.26/vhdl/sem_decls.adb ghdl-0.26dev/vhdl/sem_decls.adb
--- ghdl-0.26/vhdl/sem_decls.adb	2006-09-26 01:58:43.000000000 +0200
+++ ghdl-0.26dev/vhdl/sem_decls.adb	2008-06-02 23:50:48.000000000 +0200
@@ -654,8 +654,7 @@
                     (Name_Op_Less_Equal, Iir_Predefined_Array_Less_Equal);
                end if;
 
-               Element_Type :=
-                 Get_Base_Type (Get_Element_Subtype (Type_Definition));
+               Element_Type := Get_Element_Subtype (Type_Definition);
 
                Add_Operation (Name_Op_Concatenation,
                               Iir_Predefined_Array_Array_Concat,
diff -urN ghdl-0.26/vhdl/sem_expr.adb ghdl-0.26dev/vhdl/sem_expr.adb
--- ghdl-0.26/vhdl/sem_expr.adb	2007-03-24 08:37:15.000000000 +0100
+++ ghdl-0.26dev/vhdl/sem_expr.adb	2008-06-02 23:50:48.000000000 +0200
@@ -168,7 +168,8 @@
            | Iir_Kind_Library_Clause
            | Iir_Kind_Component_Declaration
            | Iir_Kinds_Procedure_Declaration
-           | Iir_Kind_Range_Array_Attribute =>
+           | Iir_Kind_Range_Array_Attribute
+           | Iir_Kind_Element_Declaration =>
             Error_Msg_Sem (Disp_Node (Expr)
                            & " not allowed in an expression", Loc);
             return Null_Iir;
@@ -2739,7 +2740,8 @@
 
          when Iir_Kind_String_Literal
            | Iir_Kind_Bit_String_Literal =>
-            Len := Sem_String_Literal (Aggr, Get_Element_Subtype (A_Type));
+            Len := Sem_String_Literal
+              (Aggr, Get_Base_Type (Get_Element_Subtype (A_Type)));
             Assoc_Chain := Null_Iir;
             Info.Min_Length := Integer'Max (Info.Min_Length, Len);
             Is_Positional := True;
@@ -2825,14 +2827,21 @@
             --  index subtype of the aggregate and the smallest and largest
             --  choice given.
             if Choice_Staticness = Locally then
-               case Get_Direction (Index_Constraint) is
-                  when Iir_To =>
-                     Set_Left_Limit (Index_Subtype_Constraint, Low);
-                     Set_Right_Limit (Index_Subtype_Constraint, High);
-                  when Iir_Downto =>
-                     Set_Left_Limit (Index_Subtype_Constraint, High);
-                     Set_Right_Limit (Index_Subtype_Constraint, Low);
-               end case;
+               if Low = Null_Iir or High = Null_Iir then
+                  --  Avoid error propagation.
+                  Set_Range_Constraint (Info.Index_Subtype,
+                                        Get_Range_Constraint (Index_Type));
+                  Free_Iir (Index_Subtype_Constraint);
+               else
+                  case Get_Direction (Index_Constraint) is
+                     when Iir_To =>
+                        Set_Left_Limit (Index_Subtype_Constraint, Low);
+                        Set_Right_Limit (Index_Subtype_Constraint, High);
+                     when Iir_Downto =>
+                        Set_Left_Limit (Index_Subtype_Constraint, High);
+                        Set_Right_Limit (Index_Subtype_Constraint, Low);
+                  end case;
+               end if;
             else
                --  Dynamic aggregate.
                declare
diff -urN ghdl-0.26/vhdl/sem_names.adb ghdl-0.26dev/vhdl/sem_names.adb
--- ghdl-0.26/vhdl/sem_names.adb	2007-03-28 00:36:16.000000000 +0200
+++ ghdl-0.26dev/vhdl/sem_names.adb	2008-06-02 23:50:48.000000000 +0200
@@ -1573,7 +1573,8 @@
            | Iir_Kind_Selected_Element
            | Iir_Kind_Dereference
            | Iir_Kind_Implicit_Dereference
-           | Iir_Kind_Attribute_Value =>
+           | Iir_Kind_Attribute_Value
+           | Iir_Kind_Function_Call =>
             if Get_Kind (Get_Type (Prefix))
               = Iir_Kind_Protected_Type_Declaration
             then
diff -urN ghdl-0.26/vhdl/translation.adb ghdl-0.26dev/vhdl/translation.adb
--- ghdl-0.26/vhdl/translation.adb	2007-03-14 00:12:38.000000000 +0100
+++ ghdl-0.26dev/vhdl/translation.adb	2008-06-02 23:50:40.000000000 +0200
@@ -11047,6 +11047,10 @@
          Push_Identifier_Prefix
            (Mark3, Get_Identifier (Get_Base_Name (Formal)));
 
+         if Is_Anonymous_Type_Definition (In_Type) then
+            In_Type := Get_Base_Type (In_Type);
+         end if;
+
          Out_Info := Get_Info (Out_Type);
          In_Info := Get_Info (In_Type);
 
@@ -11794,15 +11798,16 @@
       begin
          Obj := Sem_Names.Name_To_Object (Expr);
          if Obj /= Null_Iir then
-            case Get_Kind (Get_Base_Name (Obj)) is
-               when Iir_Kind_Signal_Declaration
-                 | Iir_Kind_Signal_Interface_Declaration
-                 | Iir_Kind_Guard_Signal_Declaration
-                 | Iir_Kinds_Signal_Attribute =>
-                  return True;
-               when others =>
-                  return False;
-            end case;
+            return Is_Signal_Object (Obj);
+--              case Get_Kind (Get_Base_Name (Obj)) is
+--                 when Iir_Kind_Signal_Declaration
+--                   | Iir_Kind_Signal_Interface_Declaration
+--                   | Iir_Kind_Guard_Signal_Declaration
+--                   | Iir_Kinds_Signal_Attribute =>
+--                    return True;
+--                 when others =>
+--                    return False;
+--              end case;
          else
             return False;
          end if;
@@ -26794,9 +26799,9 @@
                     (Mark, Name_Table.Get_Identifier ("DEFAULT_CONFIG"));
                   Chap1.Translate_Configuration_Declaration (El);
                   Pop_Identifier_Prefix (Mark);
-                  Pop_Identifier_Prefix (Mark_Entity);
-                  Pop_Identifier_Prefix (Mark_Sep);
                   Pop_Identifier_Prefix (Mark_Arch);
+                  Pop_Identifier_Prefix (Mark_Sep);
+                  Pop_Identifier_Prefix (Mark_Entity);
                end;
             else
                Chap1.Translate_Configuration_Declaration (El);
@@ -28308,6 +28313,7 @@
          Assoc : O_Assoc_List;
          Instance : O_Dnode;
          Arch_Instance : O_Dnode;
+         Mark : Id_Mark_Type;
       begin
          Arch_Info := Get_Info (Arch);
          Entity_Info := Get_Info (Entity);
@@ -28376,6 +28382,7 @@
 
          --  init instance
          Push_Scope (Entity_Info.Block_Decls_Type, Instance);
+         Push_Identifier_Prefix (Mark, "");
          Chap1.Translate_Entity_Init (Entity);
 
          --  elab instance
@@ -28390,6 +28397,7 @@
          New_Association (Assoc, New_Obj_Value (Arch_Instance));
          New_Procedure_Call (Assoc);
 
+         Pop_Identifier_Prefix (Mark);
          Pop_Scope (Entity_Info.Block_Decls_Type);
          Finish_Subprogram_Body;
 
diff -urN ghdl-0.26/vhdl/types.ads ghdl-0.26dev/vhdl/types.ads
--- ghdl-0.26/vhdl/types.ads	2005-09-22 23:23:20.000000000 +0200
+++ ghdl-0.26dev/vhdl/types.ads	2008-06-02 23:50:48.000000000 +0200
@@ -121,4 +121,9 @@
    --  Self-explaining: raised when an internal error (such as consistency)
    --  is detected.
    Internal_Error: exception;
+
+   --  In some case, a low level subprogram can't handle error
+   --  (e.g eval_pos).  In this case it is easier to raise an exception and
+   --  let upper level subprograms handle the case.
+   Node_Error : exception;
 end Types;
diff -urN ghdl-0.26/vhdl/version.ads ghdl-0.26dev/vhdl/version.ads
--- ghdl-0.26/vhdl/version.ads	2007-04-08 18:43:04.000000000 +0200
+++ ghdl-0.26dev/vhdl/version.ads	2008-06-02 23:50:48.000000000 +0200
@@ -1,5 +1,5 @@
 package Version is
    Ghdl_Release : constant String :=
-      "GHDL 0.26 (20070408) [Sokcho edition]";
+      "GHDL 0.26dev (20070408) [Sokcho edition]";
    Ghdl_Ver : constant String := "0.26";
 end Version;


Index: ghdl.spec
===================================================================
RCS file: /cvs/extras/rpms/ghdl/devel/ghdl.spec,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- ghdl.spec	24 May 2008 12:56:16 -0000	1.37
+++ ghdl.spec	2 Jun 2008 21:58:52 -0000	1.38
@@ -1,11 +1,11 @@
 %define gccver 4.1.2
 %define ghdlver 0.26
-%define ghdlsvnver 94
+%define ghdlsvnver 98
 
 Summary: A VHDL simulator, using the GCC technology
 Name: ghdl
 Version: %{ghdlver}
-Release: 0.%{ghdlsvnver}svn.7%{?dist}
+Release: 0.%{ghdlsvnver}svn.0%{?dist}
 License: GPLv2+
 Group: Development/Languages
 URL: http://ghdl.free.fr/
@@ -296,6 +296,9 @@
 
 
 %changelog
+* Mon Jun  2 2008 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.26-0.98svn.0
+- update to svn98
+
 * Fri May 16 2008 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.26-0.94svn.7
 - update to svn94
 


--- ghdl-svn94.patch DELETED ---




More information about the fedora-extras-commits mailing list