From e9f3eb97607bc49b6bb77229f1fad9796aea1483 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 22 Aug 2019 18:43:16 +0200 Subject: Bump year in copyright notice Signed-off-by: Clifford Wolf --- kernel/yosys.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/yosys.cc b/kernel/yosys.cc index 747f2d739..5018a4888 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -129,7 +129,7 @@ void yosys_banner() log(" | |\n"); log(" | yosys -- Yosys Open SYnthesis Suite |\n"); log(" | |\n"); - log(" | Copyright (C) 2012 - 2018 Clifford Wolf |\n"); + log(" | Copyright (C) 2012 - 2019 Clifford Wolf |\n"); log(" | |\n"); log(" | Permission to use, copy, modify, and/or distribute this software for any |\n"); log(" | purpose with or without fee is hereby granted, provided that the above |\n"); -- cgit v1.2.3 From 4ea34aaacdf6f76e11a83d5eb2a53ba7e75f7c11 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 12 Sep 2019 11:45:02 -0700 Subject: SigSet to use stable compare class --- kernel/consteval.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/consteval.h b/kernel/consteval.h index 7a83d28e7..c1c0c45cc 100644 --- a/kernel/consteval.h +++ b/kernel/consteval.h @@ -33,7 +33,7 @@ struct ConstEval SigMap assign_map; SigMap values_map; SigPool stop_signals; - SigSet sig2driver; + SigSet> sig2driver; std::set busy; std::vector stack; RTLIL::State defaultval; -- cgit v1.2.3 From c05a403dd10cdc847c81baff962068d9b401053a Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 12 Sep 2019 11:45:17 -0700 Subject: static_assert to enforce this going forward --- kernel/sigtools.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kernel') diff --git a/kernel/sigtools.h b/kernel/sigtools.h index 4e97bb775..094d73941 100644 --- a/kernel/sigtools.h +++ b/kernel/sigtools.h @@ -138,6 +138,8 @@ struct SigPool template > struct SigSet { + static_assert(!std::is_pointer::value || !std::is_same>::value, "Explicit `Compare' class require for SigSet with pointer-type values!"); + struct bitDef_t : public std::pair { bitDef_t() : std::pair(NULL, 0) { } bitDef_t(const RTLIL::SigBit &bit) : std::pair(bit.wire, bit.offset) { } -- cgit v1.2.3 From c487a8ff25a89506423e868ff3b4345bc36a8e00 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 12 Sep 2019 12:00:34 -0700 Subject: Grammar --- kernel/sigtools.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/sigtools.h b/kernel/sigtools.h index 094d73941..2f2d3f5c6 100644 --- a/kernel/sigtools.h +++ b/kernel/sigtools.h @@ -138,7 +138,7 @@ struct SigPool template > struct SigSet { - static_assert(!std::is_pointer::value || !std::is_same>::value, "Explicit `Compare' class require for SigSet with pointer-type values!"); + static_assert(!std::is_pointer::value || !std::is_same>::value, "Explicit `Compare' class required for SigSet with pointer-type values!"); struct bitDef_t : public std::pair { bitDef_t() : std::pair(NULL, 0) { } -- cgit v1.2.3 From 95e80809a5801743fabb2836fa25f3c3732a9a24 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 13 Sep 2019 09:49:15 -0700 Subject: Revert "SigSet to use stable compare class" This reverts commit 4ea34aaacdf6f76e11a83d5eb2a53ba7e75f7c11. --- kernel/consteval.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/consteval.h b/kernel/consteval.h index c1c0c45cc..7a83d28e7 100644 --- a/kernel/consteval.h +++ b/kernel/consteval.h @@ -33,7 +33,7 @@ struct ConstEval SigMap assign_map; SigMap values_map; SigPool stop_signals; - SigSet> sig2driver; + SigSet sig2driver; std::set busy; std::vector stack; RTLIL::State defaultval; -- cgit v1.2.3 From 5473e597bf5aa7a5dc7c831be332baeeddae086f Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 13 Sep 2019 11:13:57 -0700 Subject: Use template specialisation --- kernel/sigtools.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/sigtools.h b/kernel/sigtools.h index 2f2d3f5c6..8c0434ceb 100644 --- a/kernel/sigtools.h +++ b/kernel/sigtools.h @@ -135,10 +135,10 @@ struct SigPool } }; -template > +template struct SigSet { - static_assert(!std::is_pointer::value || !std::is_same>::value, "Explicit `Compare' class required for SigSet with pointer-type values!"); + static_assert(!std::is_same::value, "Default value for `Compare' class not found for SigSet. Please specify."); struct bitDef_t : public std::pair { bitDef_t() : std::pair(NULL, 0) { } @@ -222,6 +222,13 @@ struct SigSet } }; +template +class SigSet::value>::type> : public SigSet> {}; +template +using sort_by_name_id_guard = typename std::enable_if::value>::type; +template +class SigSet> : public SigSet::type>> {}; + struct SigMap { mfp database; -- cgit v1.2.3 From 9a84e4711cfa7a6ee82b8d67a48be96064659651 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 13 Sep 2019 16:30:44 -0700 Subject: Spacing --- kernel/sigtools.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/sigtools.h b/kernel/sigtools.h index 8c0434ceb..2517d6de3 100644 --- a/kernel/sigtools.h +++ b/kernel/sigtools.h @@ -135,7 +135,7 @@ struct SigPool } }; -template +template struct SigSet { static_assert(!std::is_same::value, "Default value for `Compare' class not found for SigSet. Please specify."); -- cgit v1.2.3 From 435300f9304a230680bdc054d0f0b3a3205b05f7 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Thu, 26 Sep 2019 19:35:12 +0200 Subject: Make read/write gzip files on macos works, fixes #1357 --- kernel/register.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'kernel') diff --git a/kernel/register.cc b/kernel/register.cc index 1fd1bad1d..8131fa279 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -48,7 +48,7 @@ using zlib to write gzip-compressed data every time the stream is flushed. */ class gzip_ostream : public std::ostream { public: - gzip_ostream() + gzip_ostream() : std::ostream(nullptr) { rdbuf(&outbuf); } @@ -71,7 +71,7 @@ private: str(""); return 0; } - ~gzip_streambuf() + virtual ~gzip_streambuf() { sync(); gzclose(gzf); @@ -498,7 +498,15 @@ void Frontend::extra_args(std::istream *&f, std::string &filename, std::vector(magic), 3); + int n = 0; + while (n < 3) + { + int c = ff->get(); + if (c != EOF) { + magic[n] = (unsigned char) c; + } + n++; + } if (n == 3 && magic[0] == 0x1f && magic[1] == 0x8b) { #ifdef YOSYS_ENABLE_ZLIB log("Found gzip magic in file `%s', decompressing using zlib.\n", filename.c_str()); -- cgit v1.2.3