/* * nextpnr -- Next Generation Place and Route * * Copyright (C) 2018 David Shah * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #ifndef NEXTPNR_H #error Include "archdefs.h" via "nextpnr.h" only. #endif #include NEXTPNR_NAMESPACE_BEGIN typedef int delay_t; struct DelayInfo { delay_t min_delay = 0, max_delay = 0; delay_t minRaiseDelay() const { return min_delay; } delay_t maxRaiseDelay() const { return max_delay; } delay_t minFallDelay() const { return min_delay; } delay_t maxFallDelay() const { return max_delay; } delay_t minDelay() const { return min_delay; } delay_t maxDelay() const { return max_delay; } DelayInfo operator+(const DelayInfo &other) const { DelayInfo ret; ret.min_delay = this->min_delay + other.min_delay; ret.max_delay = this->max_delay + other.max_delay; return ret; } }; // ----------------------------------------------------------------------- enum ConstIds { ID_NONE #define X(t) , ID_##t #include "constids.inc" #undef X }; #define X(t) static constexpr auto id_##t = IdString(ID_##t); #include "constids.inc" #undef X NPNR_PACKED_STRUCT(struct LocationPOD { int16_t x, y; }); struct Location { int16_t x = -1, y = -1; Location() : x(-1), y(-1){}; Location(int16_t x, int16_t y) : x(x), y(y){}; Location(const LocationPOD &pod) : x(pod.x), y(pod.y){}; Location(const Location &loc) : x(loc.x), y(loc.y){}; bool operator==(const Location &other) const { return x == other.x && y == other.y; } bool operator!=(const Location &other) const { return x != other.x || y != other.y; } bool operator<(const Location &other) const { return y == other.y ? x < other.x : y < other.y; } }; inline Location operator+(const Location &a, const Location &b) { return Location(a.x + b.x, a.y + b.y); } struct BelId { Location location; int32_t index = -1; bool operator==(const BelId &other) const { return index == other.index && location == other.location; } bool operator!=(const BelId &other) const { return index != other.index || location != other.location; } bool operator<(const BelId &other) const { return location == other.location ? index < other.index : location < other.location; } }; struct WireId { Location location; int32_t index = -1; bool operator==(const WireId &other) const { return index == other.index && location == other.location; } bool operator!=(const WireId &other) const { return index != other.index || location != other.location; } bool operator<(const WireId &other) const { return location == other.location ? index < other.index : location < other.location; } }; struct PipId { Location location; int32_t index = -1; bool operator==(const PipId &other) const { return index == other.index && location == other.location; } bool operator!=(const PipId &other) const { return index != other.index || location != other.location; } bool operator<(const PipId &other) const { return location == other.location ? index < other.index : location < other.location; } }; struct GroupId { enum : int8_t { TYPE_NONE, TYPE_SWITCHBOX } type = TYPE_NONE; Location location; bool operator==(const GroupId &other) const { return (type == other.type) && (location == other.location); } bool operator!=(const GroupId &other) const { return (type != other.type) || (location != other.location); } }; struct DecalId { enum { TYPE_NONE, TYPE_BEL, TYPE_WIRE, TYPE_PIP, TYPE_GROUP } type = TYPE_NONE; Location location; uint32_t z = 0; bool active = false; bool operator==(const DecalId &other) const { return type == other.type && location == other.location && z == other.z && active == other.active; } bool operator!=(const DecalId &other) const { return type != other.type || location != other.location || z != other.z || active != other.active; } }; struct ArchNetInfo { bool is_global = false; }; struct ArchCellInfo { struct { bool using_dff; bool has_l6mux; bool is_carry; IdString clk_sig, lsr_sig, clkmux, lsrmux, srmode; int sd0, sd1; } sliceInfo; struct { bool is_pdp; } ramInfo; }; NEXTPNR_NAMESPACE_END namespace std { template <> struct hash { std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX Location &loc) const noexcept { std::size_t seed = std::hash()(loc.x); seed ^= std::hash()(loc.y) +
--  GHDL Run Time (GRT) - wave dumper (GHW) declarations.
--  Copyright (C) 2016 Tristan Gingold
--
--  This program is free software: you can redistribute it and/or modify
--  it under the terms of the GNU General Public License as published by
--  the Free Software Foundation, either version 2 of the License, or
--  (at your option) any later version.
--
--  This program is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--  GNU General Public License for more details.
--
--  You should have received a copy of the GNU General Public License
--  along with this program.  If not, see <gnu.org/licenses>.
--
--  As a special exception, if other files instantiate generics from this
--  unit, or you link this unit with other files to produce an executable,
--  this unit does not by itself cause the resulting executable to be
--  covered by the GNU General Public License. This exception does not
--  however invalidate any other reasons why the executable file might be
--  covered by the GNU Public License.

with Interfaces; use Interfaces;

package Grt.Ghw is
   --  Hierarhcy elements.
   Ghw_Hie_Design       : constant Unsigned_8 := 1;
   Ghw_Hie_Block        : constant Unsigned_8 := 3;
   Ghw_Hie_Generate_If  : constant Unsigned_8 := 4;
   Ghw_Hie_Generate_For : constant Unsigned_8 := 5;
   Ghw_Hie_Instance     : constant Unsigned_8 := 6;
   Ghw_Hie_Package      : constant Unsigned_8 := 7;
   Ghw_Hie_Process      : constant Unsigned_8 := 13;
   Ghw_Hie_Generic      : constant Unsigned_8 := 14;
   Ghw_Hie_Eos          : constant Unsigned_8 := 15; --  End of scope.
   Ghw_Hie_Signal       : constant Unsigned_8 := 16; --  Signal.
   Ghw_Hie_Port_In      : constant Unsigned_8 := 17; --  Port
   Ghw_Hie_Port_Out     : constant Unsigned_8 := 18; --  Port
   Ghw_Hie_Port_Inout   : constant Unsigned_8 := 19; --  Port
   Ghw_Hie_Port_Buffer  : constant Unsigned_8 := 20; --  Port
   Ghw_Hie_Port_Linkage : constant Unsigned_8 := 21; --  Port

   --  Type kind was initially ghdl_rtik, but to avoid coupling, we are now
   --  using Ghw_Rtik (with old values).
   type Ghw_Rtik is new Unsigned_8;
   Ghw_Rtik_Error : constant Ghw_Rtik := 0;
   Ghw_Rtik_Eos      : constant Ghw_Rtik := 15; --  End of scope.

   Ghw_Rtik_Signal       : constant Ghw_Rtik := 16; --  Signal.
   Ghw_Rtik_Port_In      : constant Ghw_Rtik := 17; --  Port
   Ghw_Rtik_Port_Out     : constant Ghw_Rtik := 18; --  Port
   Ghw_Rtik_Port_Inout   : constant Ghw_Rtik := 19; --  Port
   Ghw_Rtik_Port_Buffer  : constant Ghw_Rtik := 20; --  Port
   Ghw_Rtik_Port_Linkage : constant Ghw_Rtik := 21; --  Port

   Ghw_Rtik_Type_B2  : constant Ghw_Rtik := 22;
   Ghw_Rtik_Type_E8  : constant Ghw_Rtik := 23;
   Ghw_Rtik_Type_E32 : constant Ghw_Rtik := 24;  --  Not used in waves
   Ghw_Rtik_Type_I32 : constant Ghw_Rtik := 25;
   Ghw_Rtik_Type_I64 : constant Ghw_Rtik := 26;
   Ghw_Rtik_Type_F64 : constant Ghw_Rtik := 27;
   Ghw_Rtik_Type_P32 : constant Ghw_Rtik := 28;
   Ghw_Rtik_Type_P64 : constant Ghw_Rtik := 29;
   Ghw_Rtik_Type_Array     : constant Ghw_Rtik := 31;
   Ghw_Rtik_Type_Record    : constant Ghw_Rtik := 32;
   Ghw_Rtik_Subtype_Scalar : constant Ghw_Rtik := 34;
   Ghw_Rtik_Subtype_Array  : constant Ghw_Rtik := 35;
   Ghw_Rtik_Subtype_Unbounded_Array  : constant Ghw_Rtik := 37;
   Ghw_Rtik_Subtype_Record : constant Ghw_Rtik := 38;
   Ghw_Rtik_Subtype_Unbounded_Record : constant Ghw_Rtik := 39;

   --  Not used in waves
   Ghw_Rtik_Subtype_B1  : constant Ghw_Rtik := 41;
   Ghw_Rtik_Subtype_E8  : constant Ghw_Rtik := 42;
   Ghw_Rtik_Subtype_E32 : constant Ghw_Rtik := 43;
   Ghw_Rtik_Subtype_I32 : constant Ghw_Rtik := 44;
   Ghw_Rtik_Subtype_I64 : constant Ghw_Rtik := 45;
   Ghw_Rtik_Subtype_F64 : constant Ghw_Rtik := 46;
   Ghw_Rtik_Subtype_P32 : constant Ghw_Rtik := 47;
   Ghw_Rtik_Subtype_P64 : constant Ghw_Rtik := 48;

end Grt.Ghw;