yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
intersynth.cc File Reference
#include "kernel/rtlil.h"
#include "kernel/register.h"
#include "kernel/sigtools.h"
#include "kernel/celltypes.h"
#include "kernel/log.h"
#include <string>
+ Include dependency graph for intersynth.cc:

Go to the source code of this file.

Data Structures

struct  IntersynthBackend
 

Functions

USING_YOSYS_NAMESPACE static
PRIVATE_NAMESPACE_BEGIN
std::string 
netname (std::set< std::string > &conntypes_code, std::set< std::string > &celltypes_code, std::set< std::string > &constcells_code, RTLIL::SigSpec sig)
 

Variables

IntersynthBackend IntersynthBackend
 

Function Documentation

USING_YOSYS_NAMESPACE static PRIVATE_NAMESPACE_BEGIN std::string netname ( std::set< std::string > &  conntypes_code,
std::set< std::string > &  celltypes_code,
std::set< std::string > &  constcells_code,
RTLIL::SigSpec  sig 
)
static

Definition at line 30 of file intersynth.cc.

31 {
32  if (!sig.is_fully_const() && !sig.is_wire())
33  log_error("Can't export composite or non-word-wide signal %s.\n", log_signal(sig));
34 
35  conntypes_code.insert(stringf("conntype b%d %d 2 %d\n", sig.size(), sig.size(), sig.size()));
36 
37  if (sig.is_fully_const()) {
38  celltypes_code.insert(stringf("celltype CONST_%d b%d *CONST cfg:%d VALUE\n", sig.size(), sig.size(), sig.size()));
39  constcells_code.insert(stringf("node CONST_%d_0x%x CONST_%d CONST CONST_%d_0x%x VALUE 0x%x\n",
40  sig.size(), sig.as_int(), sig.size(), sig.size(), sig.as_int(), sig.as_int()));
41  return stringf("CONST_%d_0x%x", sig.size(), sig.as_int());
42  }
43 
44  return RTLIL::unescape_id(sig.as_wire()->name);
45 }
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
static std::string unescape_id(std::string str)
Definition: rtlil.h:257
const char * log_signal(const RTLIL::SigSpec &sig, bool autoint)
Definition: log.cc:269
void log_error(const char *format,...)
Definition: log.cc:204
int size() const
Definition: rtlil.h:1019
bool is_wire() const
Definition: rtlil.cc:2747
bool is_fully_const() const
Definition: rtlil.cc:2763
RTLIL::IdString name
Definition: rtlil.h:825
int as_int(bool is_signed=false) const
Definition: rtlil.cc:2829
RTLIL::Wire * as_wire() const
Definition: rtlil.cc:2868

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation