Skip to content

Commit

Permalink
Add trivially copyable invariant for ID types
Browse files Browse the repository at this point in the history
Signed-off-by: gatecat <[email protected]>
  • Loading branch information
gatecat committed Jan 4, 2024
1 parent 6a9ad61 commit 6aba122
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions common/kernel/nextpnr_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@

#include "nextpnr_namespaces.h"

#include <type_traits>

NEXTPNR_NAMESPACE_BEGIN

// Invariant: architecture ID types must all be trivially copyable
static_assert(std::is_trivially_copyable<BelId>::value == true);
static_assert(std::is_trivially_copyable<WireId>::value == true);
static_assert(std::is_trivially_copyable<PipId>::value == true);

void CellInfo::addInput(IdString name)
{
ports[name].name = name;
Expand Down

0 comments on commit 6aba122

Please sign in to comment.