Skip to content

Commit f25c34f

Browse files
authored
Fix travis and add network base_type (lsils#95)
* Ignore files. * Travis. * Network base_type. * Docs.
1 parent 1b6f84d commit f25c34f

File tree

12 files changed

+29
-12
lines changed

12 files changed

+29
-12
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
build/
22
build-*/
33
.vscode/
4+
examples/
45

56
**/*~
7+
**/.DS_Store
68

79
docs/_build
810
docs/doxyxml

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ matrix:
5050
before_install:
5151
- brew update
5252
- brew install llvm
53-
env: COMPILER=/usr/local/Cellar/llvm/7.0.0/bin/clang++
53+
env: COMPILER=/usr/local/opt/llvm/bin/clang++
5454
- os: osx
5555
osx_image: xcode8.3
5656
compiler: gcc
5757
before_install:
5858
- brew update
5959
- brew install gcc
60-
env: COMPILER=/usr/local/Cellar/gcc/8.2.0/bin/g++-8
60+
env: COMPILER=/usr/local/opt/gcc/bin/g++-8
6161
- os: osx
6262
osx_image: xcode8.3
6363
compiler: gcc
6464
before_install:
6565
- brew update
6666
- brew install gcc@7
67-
env: COMPILER=/usr/local/Cellar/gcc@7/7.3.0/bin/g++-7
67+
env: COMPILER=/usr/local/opt/gcc@7/bin/g++-7

docs/network.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ This page describes the interface of a logic network data structure in
1818
Mandatory types and constants
1919
-----------------------------
2020

21-
The interaction with a logic network data structure is performed using three
22-
types for which no application details are assumed. The following three types
21+
The interaction with a logic network data structure is performed using four
22+
types for which no application details are assumed. The following four types
2323
must be defined within the network data structure. They can be implemented as
2424
nested type, but may also be exposed as type alias.
2525

2626
.. doxygenclass:: mockturtle::network
27-
:members: node, signal, storage
27+
:members: base_type, node, signal, storage
2828
:no-link:
2929

30-
Futher, a network must expose the following compile-time constants:
30+
Further, a network must expose the following compile-time constants:
3131

3232
.. code-block:: c++
3333

docs/philosophy.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ The *mockturtle* philosophy
77
The mockturtle philosophy is based on a principle of 4 layers that depend on
88
each other in a linear order as depicted in the figure on the right-hand side.
99
The fundament, depicted by the bottom layer, is provided by the :ref:`network`.
10-
It defines naming conventions for types and methods for types and methods in
11-
classes that implement network interfaces, some of which are mandatory while
12-
others are optional. The network interface API does *not* provide any
13-
implementations for a network though.
10+
It defines naming conventions for types and methods in classes that implement
11+
network interfaces, some of which are mandatory while others are optional. The
12+
network interface API does *not* provide any implementations for a network
13+
though.
1414

1515
Algorithms, the second layer, are implemented in terms of generic functions
1616
that takes as input an instance of some hypothetical network type and require

include/mockturtle/interface.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ static_assert( false, "file interface.hpp cannot be included, it's only used for
4646
class network final
4747
{
4848
public:
49+
/*! \brief Type referring to itself.
50+
*
51+
* The ``base_type`` is the network type itself. It is required, because
52+
* views may extend networks, and this type provides a way to determine the
53+
* underlying network type.
54+
*/
55+
using base_type = network;
56+
4957
/*! \brief Type representing a node.
5058
*
5159
* A ``node`` is a node in the logic network. It could be a constant, a

include/mockturtle/networks/aig.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class aig_network
9090
static constexpr auto min_fanin_size = 2u;
9191
static constexpr auto max_fanin_size = 2u;
9292

93+
using base_type = aig_network;
9394
using storage = std::shared_ptr<aig_storage>;
9495
using node = uint64_t;
9596

include/mockturtle/networks/klut.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class klut_network
7575
static constexpr auto min_fanin_size = 1;
7676
static constexpr auto max_fanin_size = 32;
7777

78+
using base_type = klut_network;
7879
using storage = std::shared_ptr<klut_storage>;
7980
using node = uint64_t;
8081
using signal = uint64_t;

include/mockturtle/networks/mig.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class mig_network
6868
static constexpr auto min_fanin_size = 3u;
6969
static constexpr auto max_fanin_size = 3u;
7070

71+
using base_type = mig_network;
7172
using storage = std::shared_ptr<mig_storage>;
7273
using node = uint64_t;
7374

include/mockturtle/networks/xag.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class xag_network
8989
static constexpr auto min_fanin_size = 2u;
9090
static constexpr auto max_fanin_size = 2u;
9191

92+
using base_type = xag_network;
9293
using storage = std::shared_ptr<xag_storage>;
9394
using node = uint64_t;
9495

include/mockturtle/networks/xmg.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class xmg_network
7575
static constexpr auto min_fanin_size = 3u;
7676
static constexpr auto max_fanin_size = 3u;
7777

78+
using base_type = xmg_network;
7879
using storage = std::shared_ptr<xmg_storage>;
7980
using node = std::size_t;
8081

0 commit comments

Comments
 (0)