mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	Merge branch 'YosysHQ:main' into main
This commit is contained in:
		
						commit
						0e3adb38fc
					
				
					 12 changed files with 9084 additions and 6596 deletions
				
			
		
							
								
								
									
										1
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -1143,6 +1143,7 @@ vcxsrc: $(GENFILES) $(EXTRA_TARGETS)
 | 
				
			||||||
	rm -rf yosys-win32-vcxsrc-$(YOSYS_VER){,.zip}
 | 
						rm -rf yosys-win32-vcxsrc-$(YOSYS_VER){,.zip}
 | 
				
			||||||
	set -e; for f in `ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \
 | 
						set -e; for f in `ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \
 | 
				
			||||||
		echo "Analyse: $$f" >&2; cpp -std=c++17 -MM -I. -D_YOSYS_ $$f; done | sed 's,.*:,,; s,//*,/,g; s,/[^/]*/\.\./,/,g; y, \\,\n\n,;' | grep '^[^/]' | sort -u | grep -v kernel/version_ > srcfiles.txt
 | 
							echo "Analyse: $$f" >&2; cpp -std=c++17 -MM -I. -D_YOSYS_ $$f; done | sed 's,.*:,,; s,//*,/,g; s,/[^/]*/\.\./,/,g; y, \\,\n\n,;' | grep '^[^/]' | sort -u | grep -v kernel/version_ > srcfiles.txt
 | 
				
			||||||
 | 
						echo "libs/fst/fst_win_unistd.h" >> srcfiles.txt
 | 
				
			||||||
	bash misc/create_vcxsrc.sh yosys-win32-vcxsrc $(YOSYS_VER) $(GIT_REV)
 | 
						bash misc/create_vcxsrc.sh yosys-win32-vcxsrc $(YOSYS_VER) $(GIT_REV)
 | 
				
			||||||
	echo "namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel/version.cc
 | 
						echo "namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel/version.cc
 | 
				
			||||||
	zip yosys-win32-vcxsrc-$(YOSYS_VER)/genfiles.zip $(GENFILES) kernel/version.cc
 | 
						zip yosys-win32-vcxsrc-$(YOSYS_VER)/genfiles.zip $(GENFILES) kernel/version.cc
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										58
									
								
								libs/fst/00_PATCH_win_io.patch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								libs/fst/00_PATCH_win_io.patch
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,58 @@
 | 
				
			||||||
 | 
					--- fst_win_unistd.h
 | 
				
			||||||
 | 
					+++ fst_win_unistd.h
 | 
				
			||||||
 | 
					@@ -26,7 +26,7 @@
 | 
				
			||||||
 | 
					 #define WIN_UNISTD_H
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					 #include <stdlib.h>
 | 
				
			||||||
 | 
					-#ifdef _WIN64
 | 
				
			||||||
 | 
					+#if defined(_MSC_VER)
 | 
				
			||||||
 | 
					 #include <io.h>
 | 
				
			||||||
 | 
					 #else
 | 
				
			||||||
 | 
					 #include <sys/io.h>
 | 
				
			||||||
 | 
					--- fstapi.cc
 | 
				
			||||||
 | 
					+++ fstapi.cc
 | 
				
			||||||
 | 
					@@ -56,7 +56,7 @@
 | 
				
			||||||
 | 
					 #include <pthread.h>
 | 
				
			||||||
 | 
					 #endif
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					-#ifdef __MINGW32__
 | 
				
			||||||
 | 
					+#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER
 | 
				
			||||||
 | 
					 #define WIN32_LEAN_AND_MEAN
 | 
				
			||||||
 | 
					 #include <windows.h>
 | 
				
			||||||
 | 
					 #endif
 | 
				
			||||||
 | 
					@@ -137,7 +137,7 @@ void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint3
 | 
				
			||||||
 | 
					 #include <sys/sysctl.h>
 | 
				
			||||||
 | 
					 #endif
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					-#if defined(FST_MACOSX) || defined(__MINGW32__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
 | 
				
			||||||
 | 
					+#if defined(FST_MACOSX) || defined(__MINGW32__) || defined(_MSC_VER) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
 | 
				
			||||||
 | 
					 #define FST_UNBUFFERED_IO
 | 
				
			||||||
 | 
					 #endif
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					@@ -159,7 +159,7 @@ void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint3
 | 
				
			||||||
 | 
					 /***                 ***/
 | 
				
			||||||
 | 
					 /***********************/
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					-#ifdef __MINGW32__
 | 
				
			||||||
 | 
					+#if defined(__MINGW32__) || defined(_MSC_VER)
 | 
				
			||||||
 | 
					 #include <io.h>
 | 
				
			||||||
 | 
					 #ifndef HAVE_FSEEKO
 | 
				
			||||||
 | 
					 #define ftello _ftelli64
 | 
				
			||||||
 | 
					@@ -341,7 +341,7 @@ return(NULL);
 | 
				
			||||||
 | 
					 /*
 | 
				
			||||||
 | 
					  * mmap compatibility
 | 
				
			||||||
 | 
					  */
 | 
				
			||||||
 | 
					-#if defined __MINGW32__
 | 
				
			||||||
 | 
					+#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER
 | 
				
			||||||
 | 
					 #include <limits.h>
 | 
				
			||||||
 | 
					 #define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off))
 | 
				
			||||||
 | 
					 #define fstMunmap(__addr,__len)                         UnmapViewOfFile((LPCVOID)__addr)
 | 
				
			||||||
 | 
					@@ -4638,7 +4638,7 @@ if(sectype == FST_BL_ZWRAPPER)
 | 
				
			||||||
 | 
					 #endif
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					         fstReaderFseeko(xc, xc->f, FST_ZWRAPPER_HDR_SIZE, SEEK_SET);
 | 
				
			||||||
 | 
					-#ifndef __MINGW32__
 | 
				
			||||||
 | 
					+#if !defined(__MINGW32__) && !defined(_MSC_VER)
 | 
				
			||||||
 | 
					         fflush(xc->f);
 | 
				
			||||||
 | 
					 #else
 | 
				
			||||||
 | 
					 	/* Windows UCRT runtime library reads one byte ahead in the file
 | 
				
			||||||
							
								
								
									
										16
									
								
								libs/fst/00_PATCH_win_zlib.patch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								libs/fst/00_PATCH_win_zlib.patch
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,16 @@
 | 
				
			||||||
 | 
					--- fstapi.h
 | 
				
			||||||
 | 
					+++ fstapi.h
 | 
				
			||||||
 | 
					@@ -33,11 +33,12 @@ extern "C" {
 | 
				
			||||||
 | 
					 #include <stdlib.h>
 | 
				
			||||||
 | 
					 #include <string.h>
 | 
				
			||||||
 | 
					 #include <ctype.h>
 | 
				
			||||||
 | 
					-#include <zlib.h>
 | 
				
			||||||
 | 
					 #include <inttypes.h>
 | 
				
			||||||
 | 
					 #if defined(_MSC_VER)
 | 
				
			||||||
 | 
					+    #include "libs/zlib/zlib.h"
 | 
				
			||||||
 | 
					     #include "fst_win_unistd.h"
 | 
				
			||||||
 | 
					 #else
 | 
				
			||||||
 | 
					+    #include <zlib.h>
 | 
				
			||||||
 | 
					     #include <unistd.h>
 | 
				
			||||||
 | 
					 #endif
 | 
				
			||||||
 | 
					 #include <time.h>
 | 
				
			||||||
							
								
								
									
										19
									
								
								libs/fst/00_UPDATE.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										19
									
								
								libs/fst/00_UPDATE.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -0,0 +1,19 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					mv config.h config.h.bak
 | 
				
			||||||
 | 
					rm -f *.txt *.cc *.h
 | 
				
			||||||
 | 
					git clone --depth 1 https://github.com/gtkwave/gtkwave fst_upstream
 | 
				
			||||||
 | 
					rm fst_upstream/lib/libfst/CMakeLists.txt
 | 
				
			||||||
 | 
					mv fst_upstream/lib/libfst/*.{h,c,txt} .
 | 
				
			||||||
 | 
					rm -rf fst_upstream
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for src in *.c; do
 | 
				
			||||||
 | 
					    mv -- "$src" "${src%.c}.cc"
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					mv config.h.bak config.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sed -i -e 's,<config.h>,"config.h",' *.cc *.h
 | 
				
			||||||
 | 
					sed -i -e 's,"fastlz.c","fastlz.cc",' *.cc *.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					patch -p0 < 00_PATCH_win_zlib.patch
 | 
				
			||||||
 | 
					patch -p0 < 00_PATCH_win_io.patch
 | 
				
			||||||
| 
						 | 
					@ -36,6 +36,7 @@
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#define FASTLZ_SAFE
 | 
					#define FASTLZ_SAFE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Give hints to the compiler for branch prediction optimization.
 | 
					 * Give hints to the compiler for branch prediction optimization.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					@ -96,12 +97,7 @@ int fastlz_decompress(const void *input, int length, void *output, int maxout);
 | 
				
			||||||
#define HASH_LOG  13
 | 
					#define HASH_LOG  13
 | 
				
			||||||
#define HASH_SIZE (1<< HASH_LOG)
 | 
					#define HASH_SIZE (1<< HASH_LOG)
 | 
				
			||||||
#define HASH_MASK  (HASH_SIZE-1)
 | 
					#define HASH_MASK  (HASH_SIZE-1)
 | 
				
			||||||
#define HASH_FUNCTION(v, p)                                                                                            \
 | 
					#define HASH_FUNCTION(v,p) { v = FASTLZ_READU16(p); v ^= FASTLZ_READU16(p+1)^(v>>(16-HASH_LOG));v &= HASH_MASK; }
 | 
				
			||||||
    {                                                                                                                  \
 | 
					 | 
				
			||||||
        v = FASTLZ_READU16(p);                                                                                         \
 | 
					 | 
				
			||||||
        v ^= FASTLZ_READU16(p + 1) ^ (v >> (16 - HASH_LOG));                                                           \
 | 
					 | 
				
			||||||
        v &= HASH_MASK;                                                                                                \
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#undef FASTLZ_LEVEL
 | 
					#undef FASTLZ_LEVEL
 | 
				
			||||||
#define FASTLZ_LEVEL 1
 | 
					#define FASTLZ_LEVEL 1
 | 
				
			||||||
| 
						 | 
					@ -179,15 +175,18 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void *input, int length, void *
 | 
				
			||||||
  flzuint32 copy;
 | 
					  flzuint32 copy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* sanity check */
 | 
					  /* sanity check */
 | 
				
			||||||
    if (FASTLZ_UNEXPECT_CONDITIONAL(length < 4)) {
 | 
					  if(FASTLZ_UNEXPECT_CONDITIONAL(length < 4))
 | 
				
			||||||
        if (length) {
 | 
					  {
 | 
				
			||||||
 | 
					    if(length)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
      /* create literal copy only */
 | 
					      /* create literal copy only */
 | 
				
			||||||
      *op++ = length-1;
 | 
					      *op++ = length-1;
 | 
				
			||||||
      ip_bound++;
 | 
					      ip_bound++;
 | 
				
			||||||
      while(ip <= ip_bound)
 | 
					      while(ip <= ip_bound)
 | 
				
			||||||
        *op++ = *ip++;
 | 
					        *op++ = *ip++;
 | 
				
			||||||
      return length+1;
 | 
					      return length+1;
 | 
				
			||||||
        } else
 | 
					    }
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
      return 0;
 | 
					      return 0;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -202,7 +201,8 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void *input, int length, void *
 | 
				
			||||||
  *op++ = *ip++;
 | 
					  *op++ = *ip++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* main loop */
 | 
					  /* main loop */
 | 
				
			||||||
    while (FASTLZ_EXPECT_CONDITIONAL(ip < ip_limit)) {
 | 
					  while(FASTLZ_EXPECT_CONDITIONAL(ip < ip_limit))
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
    const flzuint8* ref;
 | 
					    const flzuint8* ref;
 | 
				
			||||||
    flzuint32 distance;
 | 
					    flzuint32 distance;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -214,7 +214,8 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void *input, int length, void *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* check for a run */
 | 
					    /* check for a run */
 | 
				
			||||||
#if FASTLZ_LEVEL==2
 | 
					#if FASTLZ_LEVEL==2
 | 
				
			||||||
        if (ip[0] == ip[-1] && FASTLZ_READU16(ip - 1) == FASTLZ_READU16(ip + 1)) {
 | 
					    if(ip[0] == ip[-1] && FASTLZ_READU16(ip-1)==FASTLZ_READU16(ip+1))
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
      distance = 1;
 | 
					      distance = 1;
 | 
				
			||||||
      /* ip += 3; */ /* scan-build, never used */
 | 
					      /* ip += 3; */ /* scan-build, never used */
 | 
				
			||||||
      ref = anchor - 1 + 3;
 | 
					      ref = anchor - 1 + 3;
 | 
				
			||||||
| 
						 | 
					@ -245,7 +246,8 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void *input, int length, void *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if FASTLZ_LEVEL==2
 | 
					#if FASTLZ_LEVEL==2
 | 
				
			||||||
    /* far, needs at least 5-byte match */
 | 
					    /* far, needs at least 5-byte match */
 | 
				
			||||||
        if (distance >= MAX_DISTANCE) {
 | 
					    if(distance >= MAX_DISTANCE)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
      if(*ip++ != *ref++ || *ip++!= *ref++)
 | 
					      if(*ip++ != *ref++ || *ip++!= *ref++)
 | 
				
			||||||
        goto literal;
 | 
					        goto literal;
 | 
				
			||||||
      len += 2;
 | 
					      len += 2;
 | 
				
			||||||
| 
						 | 
					@ -260,36 +262,27 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void *input, int length, void *
 | 
				
			||||||
    /* distance is biased */
 | 
					    /* distance is biased */
 | 
				
			||||||
    distance--;
 | 
					    distance--;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!distance) {
 | 
					    if(!distance)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
      /* zero distance means a run */
 | 
					      /* zero distance means a run */
 | 
				
			||||||
      flzuint8 x = ip[-1];
 | 
					      flzuint8 x = ip[-1];
 | 
				
			||||||
      while(ip < ip_bound)
 | 
					      while(ip < ip_bound)
 | 
				
			||||||
                if (*ref++ != x)
 | 
					        if(*ref++ != x) break; else ip++;
 | 
				
			||||||
                    break;
 | 
					    }
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
                    ip++;
 | 
					    for(;;)
 | 
				
			||||||
        } else
 | 
					    {
 | 
				
			||||||
            for (;;) {
 | 
					 | 
				
			||||||
      /* safe because the outer check against ip limit */
 | 
					      /* safe because the outer check against ip limit */
 | 
				
			||||||
                if (*ref++ != *ip++)
 | 
					      if(*ref++ != *ip++) break;
 | 
				
			||||||
                    break;
 | 
					      if(*ref++ != *ip++) break;
 | 
				
			||||||
                if (*ref++ != *ip++)
 | 
					      if(*ref++ != *ip++) break;
 | 
				
			||||||
                    break;
 | 
					      if(*ref++ != *ip++) break;
 | 
				
			||||||
                if (*ref++ != *ip++)
 | 
					      if(*ref++ != *ip++) break;
 | 
				
			||||||
                    break;
 | 
					      if(*ref++ != *ip++) break;
 | 
				
			||||||
                if (*ref++ != *ip++)
 | 
					      if(*ref++ != *ip++) break;
 | 
				
			||||||
                    break;
 | 
					      if(*ref++ != *ip++) break;
 | 
				
			||||||
                if (*ref++ != *ip++)
 | 
					 | 
				
			||||||
                    break;
 | 
					 | 
				
			||||||
                if (*ref++ != *ip++)
 | 
					 | 
				
			||||||
                    break;
 | 
					 | 
				
			||||||
                if (*ref++ != *ip++)
 | 
					 | 
				
			||||||
                    break;
 | 
					 | 
				
			||||||
                if (*ref++ != *ip++)
 | 
					 | 
				
			||||||
                    break;
 | 
					 | 
				
			||||||
      while(ip < ip_bound)
 | 
					      while(ip < ip_bound)
 | 
				
			||||||
                    if (*ref++ != *ip++)
 | 
					        if(*ref++ != *ip++) break;
 | 
				
			||||||
                        break;
 | 
					 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -310,26 +303,35 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void *input, int length, void *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* encode the match */
 | 
					    /* encode the match */
 | 
				
			||||||
#if FASTLZ_LEVEL==2
 | 
					#if FASTLZ_LEVEL==2
 | 
				
			||||||
        if (distance < MAX_DISTANCE) {
 | 
					    if(distance < MAX_DISTANCE)
 | 
				
			||||||
            if (len < 7) {
 | 
					    {
 | 
				
			||||||
 | 
					      if(len < 7)
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
        *op++ = (len << 5) + (distance >> 8);
 | 
					        *op++ = (len << 5) + (distance >> 8);
 | 
				
			||||||
        *op++ = (distance & 255);
 | 
					        *op++ = (distance & 255);
 | 
				
			||||||
            } else {
 | 
					      }
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
        *op++ = (7 << 5) + (distance >> 8);
 | 
					        *op++ = (7 << 5) + (distance >> 8);
 | 
				
			||||||
        for(len-=7; len >= 255; len-= 255)
 | 
					        for(len-=7; len >= 255; len-= 255)
 | 
				
			||||||
          *op++ = 255;
 | 
					          *op++ = 255;
 | 
				
			||||||
        *op++ = len;
 | 
					        *op++ = len;
 | 
				
			||||||
        *op++ = (distance & 255);
 | 
					        *op++ = (distance & 255);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
        } else {
 | 
					    }
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
      /* far away, but not yet in the another galaxy... */
 | 
					      /* far away, but not yet in the another galaxy... */
 | 
				
			||||||
            if (len < 7) {
 | 
					      if(len < 7)
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
        distance -= MAX_DISTANCE;
 | 
					        distance -= MAX_DISTANCE;
 | 
				
			||||||
        *op++ = (len << 5) + 31;
 | 
					        *op++ = (len << 5) + 31;
 | 
				
			||||||
        *op++ = 255;
 | 
					        *op++ = 255;
 | 
				
			||||||
        *op++ = distance >> 8;
 | 
					        *op++ = distance >> 8;
 | 
				
			||||||
        *op++ = distance & 255;
 | 
					        *op++ = distance & 255;
 | 
				
			||||||
            } else {
 | 
					      }
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
        distance -= MAX_DISTANCE;
 | 
					        distance -= MAX_DISTANCE;
 | 
				
			||||||
        *op++ = (7 << 5) + 31;
 | 
					        *op++ = (7 << 5) + 31;
 | 
				
			||||||
        for(len-=7; len >= 255; len-= 255)
 | 
					        for(len-=7; len >= 255; len-= 255)
 | 
				
			||||||
| 
						 | 
					@ -343,17 +345,21 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void *input, int length, void *
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if(FASTLZ_UNEXPECT_CONDITIONAL(len > MAX_LEN-2))
 | 
					    if(FASTLZ_UNEXPECT_CONDITIONAL(len > MAX_LEN-2))
 | 
				
			||||||
            while (len > MAX_LEN - 2) {
 | 
					      while(len > MAX_LEN-2)
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
        *op++ = (7 << 5) + (distance >> 8);
 | 
					        *op++ = (7 << 5) + (distance >> 8);
 | 
				
			||||||
        *op++ = MAX_LEN - 2 - 7 -2;
 | 
					        *op++ = MAX_LEN - 2 - 7 -2;
 | 
				
			||||||
        *op++ = (distance & 255);
 | 
					        *op++ = (distance & 255);
 | 
				
			||||||
        len -= MAX_LEN-2;
 | 
					        len -= MAX_LEN-2;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (len < 7) {
 | 
					    if(len < 7)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
      *op++ = (len << 5) + (distance >> 8);
 | 
					      *op++ = (len << 5) + (distance >> 8);
 | 
				
			||||||
      *op++ = (distance & 255);
 | 
					      *op++ = (distance & 255);
 | 
				
			||||||
        } else {
 | 
					    }
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
      *op++ = (7 << 5) + (distance >> 8);
 | 
					      *op++ = (7 << 5) + (distance >> 8);
 | 
				
			||||||
      *op++ = len - 7;
 | 
					      *op++ = len - 7;
 | 
				
			||||||
      *op++ = (distance & 255);
 | 
					      *op++ = (distance & 255);
 | 
				
			||||||
| 
						 | 
					@ -375,7 +381,8 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void *input, int length, void *
 | 
				
			||||||
      *op++ = *anchor++;
 | 
					      *op++ = *anchor++;
 | 
				
			||||||
      ip = anchor;
 | 
					      ip = anchor;
 | 
				
			||||||
      copy++;
 | 
					      copy++;
 | 
				
			||||||
        if (FASTLZ_UNEXPECT_CONDITIONAL(copy == MAX_COPY)) {
 | 
					      if(FASTLZ_UNEXPECT_CONDITIONAL(copy == MAX_COPY))
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
        copy = 0;
 | 
					        copy = 0;
 | 
				
			||||||
        *op++ = MAX_COPY-1;
 | 
					        *op++ = MAX_COPY-1;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					@ -383,10 +390,12 @@ static FASTLZ_INLINE int FASTLZ_COMPRESSOR(const void *input, int length, void *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* left-over as literal copy */
 | 
					  /* left-over as literal copy */
 | 
				
			||||||
  ip_bound++;
 | 
					  ip_bound++;
 | 
				
			||||||
    while (ip <= ip_bound) {
 | 
					  while(ip <= ip_bound)
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
    *op++ = *ip++;
 | 
					    *op++ = *ip++;
 | 
				
			||||||
    copy++;
 | 
					    copy++;
 | 
				
			||||||
        if (copy == MAX_COPY) {
 | 
					    if(copy == MAX_COPY)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
      copy = 0;
 | 
					      copy = 0;
 | 
				
			||||||
      *op++ = MAX_COPY-1;
 | 
					      *op++ = MAX_COPY-1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -415,12 +424,14 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void *input, int length, void
 | 
				
			||||||
  flzuint32 ctrl = (*ip++) & 31;
 | 
					  flzuint32 ctrl = (*ip++) & 31;
 | 
				
			||||||
  int loop = 1;
 | 
					  int loop = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    do {
 | 
					  do
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
    const flzuint8* ref = op;
 | 
					    const flzuint8* ref = op;
 | 
				
			||||||
    flzuint32 len = ctrl >> 5;
 | 
					    flzuint32 len = ctrl >> 5;
 | 
				
			||||||
    flzuint32 ofs = (ctrl & 31) << 8;
 | 
					    flzuint32 ofs = (ctrl & 31) << 8;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (ctrl >= 32) {
 | 
					    if(ctrl >= 32)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
#if FASTLZ_LEVEL==2
 | 
					#if FASTLZ_LEVEL==2
 | 
				
			||||||
      flzuint8 code;
 | 
					      flzuint8 code;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					@ -431,7 +442,8 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void *input, int length, void
 | 
				
			||||||
        len += *ip++;
 | 
					        len += *ip++;
 | 
				
			||||||
      ref -= *ip++;
 | 
					      ref -= *ip++;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
                do {
 | 
					        do
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
          code = *ip++;
 | 
					          code = *ip++;
 | 
				
			||||||
          len += code;
 | 
					          len += code;
 | 
				
			||||||
        } while (code==255);
 | 
					        } while (code==255);
 | 
				
			||||||
| 
						 | 
					@ -440,7 +452,8 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void *input, int length, void
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      /* match from 16-bit distance */
 | 
					      /* match from 16-bit distance */
 | 
				
			||||||
      if(FASTLZ_UNEXPECT_CONDITIONAL(code==255))
 | 
					      if(FASTLZ_UNEXPECT_CONDITIONAL(code==255))
 | 
				
			||||||
                if (FASTLZ_EXPECT_CONDITIONAL(ofs == (31 << 8))) {
 | 
					      if(FASTLZ_EXPECT_CONDITIONAL(ofs==(31 << 8)))
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
        ofs = (*ip++) << 8;
 | 
					        ofs = (*ip++) << 8;
 | 
				
			||||||
        ofs += *ip++;
 | 
					        ofs += *ip++;
 | 
				
			||||||
        ref = op - ofs - MAX_DISTANCE;
 | 
					        ref = op - ofs - MAX_DISTANCE;
 | 
				
			||||||
| 
						 | 
					@ -460,7 +473,8 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void *input, int length, void
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        loop = 0;
 | 
					        loop = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (ref == op) {
 | 
					      if(ref == op)
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
        /* optimize copy for a run */
 | 
					        /* optimize copy for a run */
 | 
				
			||||||
        flzuint8 b = ref[-1];
 | 
					        flzuint8 b = ref[-1];
 | 
				
			||||||
        *op++ = b;
 | 
					        *op++ = b;
 | 
				
			||||||
| 
						 | 
					@ -468,7 +482,9 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void *input, int length, void
 | 
				
			||||||
        *op++ = b;
 | 
					        *op++ = b;
 | 
				
			||||||
        for(; len; --len)
 | 
					        for(; len; --len)
 | 
				
			||||||
          *op++ = b;
 | 
					          *op++ = b;
 | 
				
			||||||
            } else {
 | 
					      }
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
#if !defined(FASTLZ_STRICT_ALIGN)
 | 
					#if !defined(FASTLZ_STRICT_ALIGN)
 | 
				
			||||||
        const flzuint16* p;
 | 
					        const flzuint16* p;
 | 
				
			||||||
        flzuint16* q;
 | 
					        flzuint16* q;
 | 
				
			||||||
| 
						 | 
					@ -481,7 +497,8 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void *input, int length, void
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !defined(FASTLZ_STRICT_ALIGN)
 | 
					#if !defined(FASTLZ_STRICT_ALIGN)
 | 
				
			||||||
        /* copy a byte, so that now it's word aligned */
 | 
					        /* copy a byte, so that now it's word aligned */
 | 
				
			||||||
                if (len & 1) {
 | 
					        if(len & 1)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
          *op++ = *ref++;
 | 
					          *op++ = *ref++;
 | 
				
			||||||
          len--;
 | 
					          len--;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -490,7 +507,8 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void *input, int length, void
 | 
				
			||||||
        q = (flzuint16*) op;
 | 
					        q = (flzuint16*) op;
 | 
				
			||||||
        op += len;
 | 
					        op += len;
 | 
				
			||||||
        p = (const flzuint16*) ref;
 | 
					        p = (const flzuint16*) ref;
 | 
				
			||||||
                for (len >>= 1; len > 4; len -= 4) {
 | 
					        for(len>>=1; len > 4; len-=4)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
          *q++ = *p++;
 | 
					          *q++ = *p++;
 | 
				
			||||||
          *q++ = *p++;
 | 
					          *q++ = *p++;
 | 
				
			||||||
          *q++ = *p++;
 | 
					          *q++ = *p++;
 | 
				
			||||||
| 
						 | 
					@ -503,7 +521,9 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void *input, int length, void
 | 
				
			||||||
          *op++ = *ref++;
 | 
					          *op++ = *ref++;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
        } else {
 | 
					    }
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
      ctrl++;
 | 
					      ctrl++;
 | 
				
			||||||
#ifdef FASTLZ_SAFE
 | 
					#ifdef FASTLZ_SAFE
 | 
				
			||||||
      if (FASTLZ_UNEXPECT_CONDITIONAL(op + ctrl > op_limit))
 | 
					      if (FASTLZ_UNEXPECT_CONDITIONAL(op + ctrl > op_limit))
 | 
				
			||||||
| 
						 | 
					@ -520,7 +540,8 @@ static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR(const void *input, int length, void
 | 
				
			||||||
      if(loop)
 | 
					      if(loop)
 | 
				
			||||||
        ctrl = *ip++;
 | 
					        ctrl = *ip++;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    } while (FASTLZ_EXPECT_CONDITIONAL(loop));
 | 
					  }
 | 
				
			||||||
 | 
					  while(FASTLZ_EXPECT_CONDITIONAL(loop));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return op - (flzuint8*)output;
 | 
					  return op - (flzuint8*)output;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										52
									
								
								libs/fst/fst_win_unistd.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								libs/fst/fst_win_unistd.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,52 @@
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Copyright (c) 2009-2018 Tony Bybell.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Permission is hereby granted, free of charge, to any person obtaining a
 | 
				
			||||||
 | 
					 * copy of this software and associated documentation files (the "Software"),
 | 
				
			||||||
 | 
					 * to deal in the Software without restriction, including without limitation
 | 
				
			||||||
 | 
					 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 | 
				
			||||||
 | 
					 * and/or sell copies of the Software, and to permit persons to whom the
 | 
				
			||||||
 | 
					 * Software is furnished to do so, subject to the following conditions:
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * The above copyright notice and this permission notice shall be included in
 | 
				
			||||||
 | 
					 * all copies or substantial portions of the Software.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
				
			||||||
 | 
					 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
				
			||||||
 | 
					 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 | 
				
			||||||
 | 
					 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
				
			||||||
 | 
					 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 | 
				
			||||||
 | 
					 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 | 
				
			||||||
 | 
					 * DEALINGS IN THE SOFTWARE.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * SPDX-License-Identifier: MIT
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef WIN_UNISTD_H
 | 
				
			||||||
 | 
					#define WIN_UNISTD_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					#if defined(_MSC_VER)
 | 
				
			||||||
 | 
					#include <io.h>
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					#include <sys/io.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <process.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define ftruncate _chsize_s
 | 
				
			||||||
 | 
					#define unlink _unlink
 | 
				
			||||||
 | 
					#define fileno _fileno
 | 
				
			||||||
 | 
					#define lseek _lseeki64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef _WIN64
 | 
				
			||||||
 | 
					#define ssize_t __int64
 | 
				
			||||||
 | 
					#define SSIZE_MAX 9223372036854775807i64
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					#define ssize_t long
 | 
				
			||||||
 | 
					#define SSIZE_MAX 2147483647L
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "stdint.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif //WIN_UNISTD_H
 | 
				
			||||||
							
								
								
									
										3777
									
								
								libs/fst/fstapi.cc
									
										
									
									
									
								
							
							
						
						
									
										3777
									
								
								libs/fst/fstapi.cc
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
					@ -36,24 +36,7 @@ extern "C" {
 | 
				
			||||||
#include <inttypes.h>
 | 
					#include <inttypes.h>
 | 
				
			||||||
#if defined(_MSC_VER)
 | 
					#if defined(_MSC_VER)
 | 
				
			||||||
    #include "libs/zlib/zlib.h"
 | 
					    #include "libs/zlib/zlib.h"
 | 
				
			||||||
#include <io.h>
 | 
					    #include "fst_win_unistd.h"
 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <process.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define ftruncate _chsize_s
 | 
					 | 
				
			||||||
#define unlink _unlink
 | 
					 | 
				
			||||||
#define fileno _fileno
 | 
					 | 
				
			||||||
#define lseek _lseeki64
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef _WIN64
 | 
					 | 
				
			||||||
#define ssize_t __int64
 | 
					 | 
				
			||||||
#define SSIZE_MAX 9223372036854775807i64
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
#define ssize_t long
 | 
					 | 
				
			||||||
#define SSIZE_MAX 2147483647L
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "stdint.h"
 | 
					 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    #include <zlib.h>
 | 
					    #include <zlib.h>
 | 
				
			||||||
    #include <unistd.h>
 | 
					    #include <unistd.h>
 | 
				
			||||||
| 
						 | 
					@ -65,15 +48,13 @@ extern "C" {
 | 
				
			||||||
typedef uint32_t fstHandle;
 | 
					typedef uint32_t fstHandle;
 | 
				
			||||||
typedef uint32_t fstEnumHandle;
 | 
					typedef uint32_t fstEnumHandle;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstWriterPackType
 | 
					enum fstWriterPackType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_WR_PT_ZLIB             = 0,
 | 
					    FST_WR_PT_ZLIB             = 0,
 | 
				
			||||||
    FST_WR_PT_FASTLZ           = 1,
 | 
					    FST_WR_PT_FASTLZ           = 1,
 | 
				
			||||||
    FST_WR_PT_LZ4              = 2
 | 
					    FST_WR_PT_LZ4              = 2
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstFileType
 | 
					enum fstFileType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_FT_MIN                 = 0,
 | 
					    FST_FT_MIN                 = 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_FT_VERILOG             = 0,
 | 
					    FST_FT_VERILOG             = 0,
 | 
				
			||||||
| 
						 | 
					@ -83,8 +64,7 @@ enum fstFileType
 | 
				
			||||||
    FST_FT_MAX                 = 2
 | 
					    FST_FT_MAX                 = 2
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstBlockType
 | 
					enum fstBlockType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_BL_HDR                 = 0,
 | 
					    FST_BL_HDR                 = 0,
 | 
				
			||||||
    FST_BL_VCDATA              = 1,
 | 
					    FST_BL_VCDATA              = 1,
 | 
				
			||||||
    FST_BL_BLACKOUT            = 2,
 | 
					    FST_BL_BLACKOUT            = 2,
 | 
				
			||||||
| 
						 | 
					@ -99,8 +79,7 @@ enum fstBlockType
 | 
				
			||||||
    FST_BL_SKIP                = 255    /* used while block is being written */
 | 
					    FST_BL_SKIP                = 255    /* used while block is being written */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstScopeType
 | 
					enum fstScopeType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_ST_MIN                 = 0,
 | 
					    FST_ST_MIN                 = 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_ST_VCD_MODULE          = 0,
 | 
					    FST_ST_VCD_MODULE          = 0,
 | 
				
			||||||
| 
						 | 
					@ -136,8 +115,7 @@ enum fstScopeType
 | 
				
			||||||
    FST_ST_VCD_UPSCOPE         = 255
 | 
					    FST_ST_VCD_UPSCOPE         = 255
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstVarType
 | 
					enum fstVarType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_VT_MIN                 = 0,     /* start of vartypes */
 | 
					    FST_VT_MIN                 = 0,     /* start of vartypes */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_VT_VCD_EVENT           = 0,
 | 
					    FST_VT_VCD_EVENT           = 0,
 | 
				
			||||||
| 
						 | 
					@ -162,8 +140,7 @@ enum fstVarType
 | 
				
			||||||
    FST_VT_VCD_SPARRAY         = 19,    /* used to define the rownum (index) port for a sparse array */
 | 
					    FST_VT_VCD_SPARRAY         = 19,    /* used to define the rownum (index) port for a sparse array */
 | 
				
			||||||
    FST_VT_VCD_REALTIME        = 20,
 | 
					    FST_VT_VCD_REALTIME        = 20,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_VT_GEN_STRING =
 | 
					    FST_VT_GEN_STRING          = 21,    /* generic string type   (max len is defined dynamically via fstWriterEmitVariableLengthValueChange) */
 | 
				
			||||||
            21, /* generic string type   (max len is defined dynamically via fstWriterEmitVariableLengthValueChange) */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_VT_SV_BIT              = 22,
 | 
					    FST_VT_SV_BIT              = 22,
 | 
				
			||||||
    FST_VT_SV_LOGIC            = 23,
 | 
					    FST_VT_SV_LOGIC            = 23,
 | 
				
			||||||
| 
						 | 
					@ -172,14 +149,12 @@ enum fstVarType
 | 
				
			||||||
    FST_VT_SV_LONGINT          = 26,    /* declare as size = 64 */
 | 
					    FST_VT_SV_LONGINT          = 26,    /* declare as size = 64 */
 | 
				
			||||||
    FST_VT_SV_BYTE             = 27,    /* declare as size = 8  */
 | 
					    FST_VT_SV_BYTE             = 27,    /* declare as size = 8  */
 | 
				
			||||||
    FST_VT_SV_ENUM             = 28,    /* declare as appropriate type range */
 | 
					    FST_VT_SV_ENUM             = 28,    /* declare as appropriate type range */
 | 
				
			||||||
    FST_VT_SV_SHORTREAL =
 | 
					    FST_VT_SV_SHORTREAL        = 29,    /* declare and emit same as FST_VT_VCD_REAL (needs to be emitted as double, not a float) */
 | 
				
			||||||
            29, /* declare and emit same as FST_VT_VCD_REAL (needs to be emitted as double, not a float) */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_VT_MAX                 = 29     /* end of vartypes */
 | 
					    FST_VT_MAX                 = 29     /* end of vartypes */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstVarDir
 | 
					enum fstVarDir {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_VD_MIN         = 0,
 | 
					    FST_VD_MIN         = 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_VD_IMPLICIT    = 0,
 | 
					    FST_VD_IMPLICIT    = 0,
 | 
				
			||||||
| 
						 | 
					@ -192,8 +167,7 @@ enum fstVarDir
 | 
				
			||||||
    FST_VD_MAX         = 5
 | 
					    FST_VD_MAX         = 5
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstHierType
 | 
					enum fstHierType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_HT_MIN         = 0,
 | 
					    FST_HT_MIN         = 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_HT_SCOPE       = 0,
 | 
					    FST_HT_SCOPE       = 0,
 | 
				
			||||||
| 
						 | 
					@ -202,16 +176,14 @@ enum fstHierType
 | 
				
			||||||
    FST_HT_ATTRBEGIN   = 3,
 | 
					    FST_HT_ATTRBEGIN   = 3,
 | 
				
			||||||
    FST_HT_ATTREND     = 4,
 | 
					    FST_HT_ATTREND     = 4,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* FST_HT_TREEBEGIN and FST_HT_TREEEND are not yet used by FST but are currently used when fstHier bridges other
 | 
					    /* FST_HT_TREEBEGIN and FST_HT_TREEEND are not yet used by FST but are currently used when fstHier bridges other formats */
 | 
				
			||||||
       formats */
 | 
					 | 
				
			||||||
    FST_HT_TREEBEGIN   = 5,
 | 
					    FST_HT_TREEBEGIN   = 5,
 | 
				
			||||||
    FST_HT_TREEEND     = 6,
 | 
					    FST_HT_TREEEND     = 6,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_HT_MAX         = 6
 | 
					    FST_HT_MAX         = 6
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstAttrType
 | 
					enum fstAttrType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_AT_MIN         = 0,
 | 
					    FST_AT_MIN         = 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_AT_MISC        = 0,     /* self-contained: does not need matching FST_HT_ATTREND */
 | 
					    FST_AT_MISC        = 0,     /* self-contained: does not need matching FST_HT_ATTREND */
 | 
				
			||||||
| 
						 | 
					@ -222,8 +194,7 @@ enum fstAttrType
 | 
				
			||||||
    FST_AT_MAX         = 3
 | 
					    FST_AT_MAX         = 3
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstMiscType
 | 
					enum fstMiscType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_MT_MIN         = 0,
 | 
					    FST_MT_MIN         = 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_MT_COMMENT     = 0,     /* use fstWriterSetComment() to emit */
 | 
					    FST_MT_COMMENT     = 0,     /* use fstWriterSetComment() to emit */
 | 
				
			||||||
| 
						 | 
					@ -239,8 +210,7 @@ enum fstMiscType
 | 
				
			||||||
    FST_MT_MAX         = 8
 | 
					    FST_MT_MAX         = 8
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstArrayType
 | 
					enum fstArrayType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_AR_MIN         = 0,
 | 
					    FST_AR_MIN         = 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_AR_NONE        = 0,
 | 
					    FST_AR_NONE        = 0,
 | 
				
			||||||
| 
						 | 
					@ -251,8 +221,7 @@ enum fstArrayType
 | 
				
			||||||
    FST_AR_MAX         = 3
 | 
					    FST_AR_MAX         = 3
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstEnumValueType
 | 
					enum fstEnumValueType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_EV_SV_INTEGER           = 0,
 | 
					    FST_EV_SV_INTEGER           = 0,
 | 
				
			||||||
    FST_EV_SV_BIT               = 1,
 | 
					    FST_EV_SV_BIT               = 1,
 | 
				
			||||||
    FST_EV_SV_LOGIC             = 2,
 | 
					    FST_EV_SV_LOGIC             = 2,
 | 
				
			||||||
| 
						 | 
					@ -274,8 +243,7 @@ enum fstEnumValueType
 | 
				
			||||||
    FST_EV_MAX                  = 15
 | 
					    FST_EV_MAX                  = 15
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstPackType
 | 
					enum fstPackType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_PT_NONE          = 0,
 | 
					    FST_PT_NONE          = 0,
 | 
				
			||||||
    FST_PT_UNPACKED      = 1,
 | 
					    FST_PT_UNPACKED      = 1,
 | 
				
			||||||
    FST_PT_PACKED        = 2,
 | 
					    FST_PT_PACKED        = 2,
 | 
				
			||||||
| 
						 | 
					@ -284,8 +252,7 @@ enum fstPackType
 | 
				
			||||||
    FST_PT_MAX           = 3
 | 
					    FST_PT_MAX           = 3
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstSupplementalVarType
 | 
					enum fstSupplementalVarType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_SVT_MIN                    = 0,
 | 
					    FST_SVT_MIN                    = 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_SVT_NONE                   = 0,
 | 
					    FST_SVT_NONE                   = 0,
 | 
				
			||||||
| 
						 | 
					@ -299,8 +266,7 @@ enum fstSupplementalVarType
 | 
				
			||||||
    FST_SVT_MAX                    = 5
 | 
					    FST_SVT_MAX                    = 5
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum fstSupplementalDataType
 | 
					enum fstSupplementalDataType {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FST_SDT_MIN                    = 0,
 | 
					    FST_SDT_MIN                    = 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_SDT_NONE                   = 0,
 | 
					    FST_SDT_NONE                   = 0,
 | 
				
			||||||
| 
						 | 
					@ -324,20 +290,18 @@ enum fstSupplementalDataType
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_SDT_MAX                    = 16,
 | 
					    FST_SDT_MAX                    = 16,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FST_SDT_SVT_SHIFT_COUNT =
 | 
					    FST_SDT_SVT_SHIFT_COUNT        = 10, /* FST_SVT_* is ORed in by fstWriterCreateVar2() to the left after shifting FST_SDT_SVT_SHIFT_COUNT */
 | 
				
			||||||
            10, /* FST_SVT_* is ORed in by fstWriterCreateVar2() to the left after shifting FST_SDT_SVT_SHIFT_COUNT */
 | 
					 | 
				
			||||||
    FST_SDT_ABS_MAX                = ((1<<(FST_SDT_SVT_SHIFT_COUNT))-1)
 | 
					    FST_SDT_ABS_MAX                = ((1<<(FST_SDT_SVT_SHIFT_COUNT))-1)
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct fstHier
 | 
					struct fstHier
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
unsigned char htyp;
 | 
					unsigned char htyp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    union
 | 
					union {
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /* if htyp == FST_HT_SCOPE */
 | 
					        /* if htyp == FST_HT_SCOPE */
 | 
				
			||||||
        struct fstHierScope
 | 
					        struct fstHierScope {
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
                unsigned char typ; /* FST_ST_MIN ... FST_ST_MAX */
 | 
					                unsigned char typ; /* FST_ST_MIN ... FST_ST_MAX */
 | 
				
			||||||
                const char *name;
 | 
					                const char *name;
 | 
				
			||||||
                const char *component;
 | 
					                const char *component;
 | 
				
			||||||
| 
						 | 
					@ -346,8 +310,7 @@ struct fstHier
 | 
				
			||||||
                } scope;
 | 
					                } scope;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* if htyp == FST_HT_VAR */
 | 
					        /* if htyp == FST_HT_VAR */
 | 
				
			||||||
        struct fstHierVar
 | 
					        struct fstHierVar {
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
                unsigned char typ; /* FST_VT_MIN ... FST_VT_MAX */
 | 
					                unsigned char typ; /* FST_VT_MIN ... FST_VT_MAX */
 | 
				
			||||||
                unsigned char direction; /* FST_VD_MIN ... FST_VD_MAX */
 | 
					                unsigned char direction; /* FST_VD_MIN ... FST_VD_MAX */
 | 
				
			||||||
                unsigned char svt_workspace; /* zeroed out by FST reader, for client code use */
 | 
					                unsigned char svt_workspace; /* zeroed out by FST reader, for client code use */
 | 
				
			||||||
| 
						 | 
					@ -361,19 +324,18 @@ struct fstHier
 | 
				
			||||||
                } var;
 | 
					                } var;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* if htyp == FST_HT_ATTRBEGIN */
 | 
					        /* if htyp == FST_HT_ATTRBEGIN */
 | 
				
			||||||
        struct fstHierAttr
 | 
					        struct fstHierAttr {
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
                unsigned char typ; /* FST_AT_MIN ... FST_AT_MAX */
 | 
					                unsigned char typ; /* FST_AT_MIN ... FST_AT_MAX */
 | 
				
			||||||
                unsigned char subtype; /* from fstMiscType, fstArrayType, fstEnumValueType, fstPackType */
 | 
					                unsigned char subtype; /* from fstMiscType, fstArrayType, fstEnumValueType, fstPackType */
 | 
				
			||||||
                const char *name;
 | 
					                const char *name;
 | 
				
			||||||
                uint64_t arg; /* number of array elements, struct members, or some other payload (possibly ignored) */
 | 
					                uint64_t arg; /* number of array elements, struct members, or some other payload (possibly ignored) */
 | 
				
			||||||
            uint64_t arg_from_name; /* for when name is overloaded as a variable-length integer (FST_AT_MISC +
 | 
					                uint64_t arg_from_name; /* for when name is overloaded as a variable-length integer (FST_AT_MISC + FST_MT_SOURCESTEM) */
 | 
				
			||||||
                                       FST_MT_SOURCESTEM) */
 | 
					 | 
				
			||||||
                uint32_t name_length; /* strlen(u.attr.name) */
 | 
					                uint32_t name_length; /* strlen(u.attr.name) */
 | 
				
			||||||
                } attr;
 | 
					                } attr;
 | 
				
			||||||
        } u;
 | 
					        } u;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct fstETab
 | 
					struct fstETab
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
char *name;
 | 
					char *name;
 | 
				
			||||||
| 
						 | 
					@ -382,34 +344,39 @@ struct fstETab
 | 
				
			||||||
char **val_arr;
 | 
					char **val_arr;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * writer functions
 | 
					 * writer functions
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
void            fstWriterClose(void *ctx);
 | 
					void            fstWriterClose(void *ctx);
 | 
				
			||||||
void *          fstWriterCreate(const char *nam, int use_compressed_hier);
 | 
					void *          fstWriterCreate(const char *nam, int use_compressed_hier);
 | 
				
			||||||
fstEnumHandle fstWriterCreateEnumTable(void *ctx, const char *name, uint32_t elem_count, unsigned int min_valbits,
 | 
					fstEnumHandle   fstWriterCreateEnumTable(void *ctx, const char *name, uint32_t elem_count, unsigned int min_valbits, const char **literal_arr, const char **val_arr);
 | 
				
			||||||
                                       const char **literal_arr, const char **val_arr);
 | 
					 | 
				
			||||||
                /* used for Verilog/SV */
 | 
					                /* used for Verilog/SV */
 | 
				
			||||||
fstHandle fstWriterCreateVar(void *ctx, enum fstVarType vt, enum fstVarDir vd, uint32_t len, const char *nam,
 | 
					fstHandle       fstWriterCreateVar(void *ctx, enum fstVarType vt, enum fstVarDir vd,
 | 
				
			||||||
                             fstHandle aliasHandle);
 | 
					                        uint32_t len, const char *nam, fstHandle aliasHandle);
 | 
				
			||||||
                /* future expansion for VHDL and other languages.  The variable type, data type, etc map onto
 | 
					                /* future expansion for VHDL and other languages.  The variable type, data type, etc map onto
 | 
				
			||||||
                   the current Verilog/SV one.  The "type" string is optional for a more verbose or custom description */
 | 
					                   the current Verilog/SV one.  The "type" string is optional for a more verbose or custom description */
 | 
				
			||||||
fstHandle fstWriterCreateVar2(void *ctx, enum fstVarType vt, enum fstVarDir vd, uint32_t len, const char *nam,
 | 
					fstHandle       fstWriterCreateVar2(void *ctx, enum fstVarType vt, enum fstVarDir vd,
 | 
				
			||||||
                              fstHandle aliasHandle, const char *type, enum fstSupplementalVarType svt,
 | 
					                        uint32_t len, const char *nam, fstHandle aliasHandle,
 | 
				
			||||||
                              enum fstSupplementalDataType sdt);
 | 
					                        const char *type, enum fstSupplementalVarType svt, enum fstSupplementalDataType sdt);
 | 
				
			||||||
void            fstWriterEmitDumpActive(void *ctx, int enable);
 | 
					void            fstWriterEmitDumpActive(void *ctx, int enable);
 | 
				
			||||||
void 		fstWriterEmitEnumTableRef(void *ctx, fstEnumHandle handle);
 | 
					void 		fstWriterEmitEnumTableRef(void *ctx, fstEnumHandle handle);
 | 
				
			||||||
void            fstWriterEmitValueChange(void *ctx, fstHandle handle, const void *val);
 | 
					void            fstWriterEmitValueChange(void *ctx, fstHandle handle, const void *val);
 | 
				
			||||||
void fstWriterEmitValueChange32(void *ctx, fstHandle handle, uint32_t bits, uint32_t val);
 | 
					void            fstWriterEmitValueChange32(void *ctx, fstHandle handle,
 | 
				
			||||||
void fstWriterEmitValueChange64(void *ctx, fstHandle handle, uint32_t bits, uint64_t val);
 | 
					                        uint32_t bits, uint32_t val);
 | 
				
			||||||
void fstWriterEmitValueChangeVec32(void *ctx, fstHandle handle, uint32_t bits, const uint32_t *val);
 | 
					void            fstWriterEmitValueChange64(void *ctx, fstHandle handle,
 | 
				
			||||||
void fstWriterEmitValueChangeVec64(void *ctx, fstHandle handle, uint32_t bits, const uint64_t *val);
 | 
					                        uint32_t bits, uint64_t val);
 | 
				
			||||||
 | 
					void            fstWriterEmitValueChangeVec32(void *ctx, fstHandle handle,
 | 
				
			||||||
 | 
					                        uint32_t bits, const uint32_t *val);
 | 
				
			||||||
 | 
					void            fstWriterEmitValueChangeVec64(void *ctx, fstHandle handle,
 | 
				
			||||||
 | 
					                        uint32_t bits, const uint64_t *val);
 | 
				
			||||||
void            fstWriterEmitVariableLengthValueChange(void *ctx, fstHandle handle, const void *val, uint32_t len);
 | 
					void            fstWriterEmitVariableLengthValueChange(void *ctx, fstHandle handle, const void *val, uint32_t len);
 | 
				
			||||||
void            fstWriterEmitTimeChange(void *ctx, uint64_t tim);
 | 
					void            fstWriterEmitTimeChange(void *ctx, uint64_t tim);
 | 
				
			||||||
void            fstWriterFlushContext(void *ctx);
 | 
					void            fstWriterFlushContext(void *ctx);
 | 
				
			||||||
int             fstWriterGetDumpSizeLimitReached(void *ctx);
 | 
					int             fstWriterGetDumpSizeLimitReached(void *ctx);
 | 
				
			||||||
int             fstWriterGetFseekFailed(void *ctx);
 | 
					int             fstWriterGetFseekFailed(void *ctx);
 | 
				
			||||||
void fstWriterSetAttrBegin(void *ctx, enum fstAttrType attrtype, int subtype, const char *attrname, uint64_t arg);
 | 
					void            fstWriterSetAttrBegin(void *ctx, enum fstAttrType attrtype, int subtype,
 | 
				
			||||||
 | 
					                        const char *attrname, uint64_t arg);
 | 
				
			||||||
void            fstWriterSetAttrEnd(void *ctx);
 | 
					void            fstWriterSetAttrEnd(void *ctx);
 | 
				
			||||||
void            fstWriterSetComment(void *ctx, const char *comm);
 | 
					void            fstWriterSetComment(void *ctx, const char *comm);
 | 
				
			||||||
void            fstWriterSetDate(void *ctx, const char *dat);
 | 
					void            fstWriterSetDate(void *ctx, const char *dat);
 | 
				
			||||||
| 
						 | 
					@ -419,7 +386,8 @@ void fstWriterSetFileType(void *ctx, enum fstFileType filetype);
 | 
				
			||||||
void            fstWriterSetPackType(void *ctx, enum fstWriterPackType typ);
 | 
					void            fstWriterSetPackType(void *ctx, enum fstWriterPackType typ);
 | 
				
			||||||
void            fstWriterSetParallelMode(void *ctx, int enable);
 | 
					void            fstWriterSetParallelMode(void *ctx, int enable);
 | 
				
			||||||
void            fstWriterSetRepackOnClose(void *ctx, int enable);       /* type = 0 (none), 1 (libz) */
 | 
					void            fstWriterSetRepackOnClose(void *ctx, int enable);       /* type = 0 (none), 1 (libz) */
 | 
				
			||||||
void fstWriterSetScope(void *ctx, enum fstScopeType scopetype, const char *scopename, const char *scopecomp);
 | 
					void            fstWriterSetScope(void *ctx, enum fstScopeType scopetype,
 | 
				
			||||||
 | 
					                        const char *scopename, const char *scopecomp);
 | 
				
			||||||
void            fstWriterSetSourceInstantiationStem(void *ctx, const char *path, unsigned int line, unsigned int use_realpath);
 | 
					void            fstWriterSetSourceInstantiationStem(void *ctx, const char *path, unsigned int line, unsigned int use_realpath);
 | 
				
			||||||
void            fstWriterSetSourceStem(void *ctx, const char *path, unsigned int line, unsigned int use_realpath);
 | 
					void            fstWriterSetSourceStem(void *ctx, const char *path, unsigned int line, unsigned int use_realpath);
 | 
				
			||||||
void            fstWriterSetTimescale(void *ctx, int ts);
 | 
					void            fstWriterSetTimescale(void *ctx, int ts);
 | 
				
			||||||
| 
						 | 
					@ -429,6 +397,7 @@ void fstWriterSetUpscope(void *ctx);
 | 
				
			||||||
void		fstWriterSetValueList(void *ctx, const char *vl);
 | 
					void		fstWriterSetValueList(void *ctx, const char *vl);
 | 
				
			||||||
void            fstWriterSetVersion(void *ctx, const char *vers);
 | 
					void            fstWriterSetVersion(void *ctx, const char *vers);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * reader functions
 | 
					 * reader functions
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					@ -461,15 +430,11 @@ const char *fstReaderGetVersionString(void *ctx);
 | 
				
			||||||
struct fstHier *fstReaderIterateHier(void *ctx);
 | 
					struct fstHier *fstReaderIterateHier(void *ctx);
 | 
				
			||||||
int             fstReaderIterateHierRewind(void *ctx);
 | 
					int             fstReaderIterateHierRewind(void *ctx);
 | 
				
			||||||
int             fstReaderIterBlocks(void *ctx,
 | 
					int             fstReaderIterBlocks(void *ctx,
 | 
				
			||||||
                        void (*value_change_callback)(void *user_callback_data_pointer, uint64_t time, fstHandle facidx,
 | 
					                        void (*value_change_callback)(void *user_callback_data_pointer, uint64_t time, fstHandle facidx, const unsigned char *value),
 | 
				
			||||||
                                                      const unsigned char *value),
 | 
					 | 
				
			||||||
                        void *user_callback_data_pointer, FILE *vcdhandle);
 | 
					                        void *user_callback_data_pointer, FILE *vcdhandle);
 | 
				
			||||||
int             fstReaderIterBlocks2(void *ctx,
 | 
					int             fstReaderIterBlocks2(void *ctx,
 | 
				
			||||||
                         void (*value_change_callback)(void *user_callback_data_pointer, uint64_t time,
 | 
					                        void (*value_change_callback)(void *user_callback_data_pointer, uint64_t time, fstHandle facidx, const unsigned char *value),
 | 
				
			||||||
                                                       fstHandle facidx, const unsigned char *value),
 | 
					                        void (*value_change_callback_varlen)(void *user_callback_data_pointer, uint64_t time, fstHandle facidx, const unsigned char *value, uint32_t len),
 | 
				
			||||||
                         void (*value_change_callback_varlen)(void *user_callback_data_pointer, uint64_t time,
 | 
					 | 
				
			||||||
                                                              fstHandle facidx, const unsigned char *value,
 | 
					 | 
				
			||||||
                                                              uint32_t len),
 | 
					 | 
				
			||||||
                        void *user_callback_data_pointer, FILE *vcdhandle);
 | 
					                        void *user_callback_data_pointer, FILE *vcdhandle);
 | 
				
			||||||
void            fstReaderIterBlocksSetNativeDoublesOnCallback(void *ctx, int enable);
 | 
					void            fstReaderIterBlocksSetNativeDoublesOnCallback(void *ctx, int enable);
 | 
				
			||||||
void *          fstReaderOpen(const char *nam);
 | 
					void *          fstReaderOpen(const char *nam);
 | 
				
			||||||
| 
						 | 
					@ -484,6 +449,7 @@ void fstReaderSetLimitTimeRange(void *ctx, uint64_t start_time, uint64_t end_tim
 | 
				
			||||||
void            fstReaderSetUnlimitedTimeRange(void *ctx);
 | 
					void            fstReaderSetUnlimitedTimeRange(void *ctx);
 | 
				
			||||||
void            fstReaderSetVcdExtensions(void *ctx, int enable);
 | 
					void            fstReaderSetVcdExtensions(void *ctx, int enable);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * utility functions
 | 
					 * utility functions
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					@ -493,6 +459,7 @@ int fstUtilityEscToBin(unsigned char *d, unsigned char *s, int len);
 | 
				
			||||||
struct fstETab *fstUtilityExtractEnumTableFromString(const char *s);
 | 
					struct fstETab *fstUtilityExtractEnumTableFromString(const char *s);
 | 
				
			||||||
void 		fstUtilityFreeEnumTable(struct fstETab *etab); /* must use to free fstETab properly */
 | 
					void 		fstUtilityFreeEnumTable(struct fstETab *etab); /* must use to free fstETab properly */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __cplusplus
 | 
					#ifdef __cplusplus
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3130
									
								
								libs/fst/lz4.cc
									
										
									
									
									
								
							
							
						
						
									
										3130
									
								
								libs/fst/lz4.cc
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										1039
									
								
								libs/fst/lz4.h
									
										
									
									
									
								
							
							
						
						
									
										1039
									
								
								libs/fst/lz4.h
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
					@ -438,8 +438,13 @@ struct BufnormPass : public Pass {
 | 
				
			||||||
				bool chain_this_wire = chain_this_wire_f(wire);
 | 
									bool chain_this_wire = chain_this_wire_f(wire);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				SigSpec keysig = sigmap(wire), insig = wire, outsig = wire;
 | 
									SigSpec keysig = sigmap(wire), insig = wire, outsig = wire;
 | 
				
			||||||
				for (int i = 0; i < GetSize(insig); i++)
 | 
									for (int i = 0; i < GetSize(insig); i++) {
 | 
				
			||||||
 | 
										if (keysig[i].is_wire())
 | 
				
			||||||
						insig[i] = mapped_bits.at(keysig[i], State::Sx);
 | 
											insig[i] = mapped_bits.at(keysig[i], State::Sx);
 | 
				
			||||||
 | 
										else
 | 
				
			||||||
 | 
											insig[i] = keysig[i];
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (chain_this_wire) {
 | 
									if (chain_this_wire) {
 | 
				
			||||||
					for (int i = 0; i < GetSize(outsig); i++)
 | 
										for (int i = 0; i < GetSize(outsig); i++)
 | 
				
			||||||
						mapped_bits[keysig[i]] = outsig[i];
 | 
											mapped_bits[keysig[i]] = outsig[i];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										11
									
								
								tests/techmap/bufnorm.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								tests/techmap/bufnorm.ys
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,11 @@
 | 
				
			||||||
 | 
					# Check wires driven by constants are kept
 | 
				
			||||||
 | 
					read_verilog <<EOT
 | 
				
			||||||
 | 
					module top(output wire [7:0] y);
 | 
				
			||||||
 | 
					assign y = 27;
 | 
				
			||||||
 | 
					endmodule
 | 
				
			||||||
 | 
					EOT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					equiv_opt -assert bufnorm
 | 
				
			||||||
 | 
					design -load postopt
 | 
				
			||||||
 | 
					select -assert-count 1 t:$buf
 | 
				
			||||||
 | 
					select -assert-count 1 w:y %ci t:$buf %i
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue