actlib_dataflow_neuro/dataflow_neuro/cell_lib_async.act

733 lines
19 KiB
Plaintext
Raw Normal View History

/*************************************************************************
*
* This file is part of ACT dataflow neuro library
*
* Copyright (c) 2022 University of Groningen - Ole Richter
* Copyright (c) 2022 University of Groningen - Hugh Greatorex
* Copyright (c) 2022 University of Groningen - Michele Mastella
*
* This source describes Open Hardware and is licensed under the CERN-OHL-W v2 or later
*
* You may redistribute and modify this documentation and make products
* using it under the terms of the CERN-OHL-W v2 (https:/cern.ch/cern-ohl).
* This documentation is distributed WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTY, INCLUDING OF MERCHANTABILITY, SATISFACTORY QUALITY
* AND FITNESS FOR A PARTICULAR PURPOSE. Please see the CERN-OHL-W v2
* for applicable conditions.
*
* Source location: https://git.web.rug.nl/bics/actlib_dataflow_neuro
*
* As per CERN-OHL-W v2 section 4.1, should You produce hardware based on
* these sources, You must maintain the Source Location visible in its
* documentation.
*
**************************************************************************
*/
namespace tmpl {
namespace dataflow_neuro{
2022-04-11 17:08:31 +02:00
export defcell KEEP (bool y; bool vdd, vss) {
2022-04-11 19:28:05 +02:00
bool _y;
prs{
2022-06-20 15:43:56 +02:00
// y => _y-
2022-04-08 11:53:49 +02:00
// [weak=1] _y -> y-
// [weak=1] ~_y -> y+
2022-03-30 15:16:15 +02:00
2022-04-11 19:28:05 +02:00
}
2022-03-28 19:51:50 +02:00
}
export defcell A_1C2N_RB_X1 (bool! y; bool? c1,n1,n2,pr_B, sr_B; bool vdd, vss) {
bool _y;
prs{
(~c1)|~pr_B -> _y+
c1 & n1 & n2 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}
}
}
export defcell A_1C1P2N_RB_X1 (bool! y; bool? c1,p1,n1,n2,pr_B, sr_B; bool vdd, vss) {
bool _y;
prs{
(~p1 & ~c1)|~pr_B -> _y+
c1 & n1 & n2 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}
}
}
2022-03-28 19:51:50 +02:00
export defcell A_2C1P1N_RB_X1 (bool! y; bool? c1,c2,p1,n1,pr_B,sr_B; bool vdd, vss) {
bool _y;
prs{
(~p1 & ~c1 & ~c2)|~pr_B -> _y+
c1 & c2 & n1 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}
}
}
export defcell A_1C1P2N_R_X1 (bool! y; bool? c1,p1,n1,n2,pr_B, sr_B; bool vdd, vss) {
prs{
(~p1 & ~c1)|~pr_B -> y-
c1 & n1 & n2 & sr_B -> y+
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}
}
}
export defcell A_1C1P_1N_X1 (bool! y; bool? c1, p1, n1; bool vdd, vss)
{
prs{
~p1 & ~c1 -> y+
c1 & n1 -> y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
export defcell A_1C1P_B (bool! y; bool? c1, p1; bool vdd, vss)
{
bool _y;
prs{
~p1 & ~c1 -> _y-
c1 -> _y+
_y => y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1} }
}
2022-02-22 13:52:54 +01:00
export defcell A_1C1P_X1 (bool! y; bool? c1, p1; bool vdd, vss)
{
prs{
~p1 & ~c1 -> y+
c1 -> y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
2022-04-01 20:45:37 +02:00
export defcell A_1C1N_X1 (bool! y; bool? c1, n1; bool vdd, vss)
{
prs{
~c1 -> y+
c1&n1-> y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
2022-04-01 16:57:44 +02:00
// export defcell A_1C1N_RB_X4 (bool! y; bool? c1, n1, pr_B, sr_B; bool vdd, vss)
// {
// bool _y;
// prs{
// ~c1 | ~pr_B-> _y+
// c1&n1&sr_B -> _y-
// _y => y-
// }
// sizing {leak_adjust <- 1;
// p_n_mode <- 1;
// y {-4}; _y{-1}}
// }
// export defcell A_1C1N_SB_X4 (bool! y; bool? c1, n1, pr, sr; bool vdd, vss)
// {
// bool _y;
// prs{
// ~c1 & ~sr-> _y+
// c1&n1 | pr -> _y-
// _y => y-
// }
// sizing {leak_adjust <- 1;
// p_n_mode <- 1;
// y {-4}; _y{-1}}
// }
2022-04-01 20:45:37 +02:00
export defcell A_1C2N_R_X1 (bool! y; bool? c1, n1, n2, pr_B, sr_B; bool vdd, vss)
{
prs{
~c1 | ~pr_B-> y+
c1&n1&n2&sr_B -> y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-4}}
}
2022-04-01 16:57:44 +02:00
export defcell A_1C2N_RB_X4 (bool! y; bool? c1, n1, n2, pr_B, sr_B; bool vdd, vss)
{
bool _y;
prs{
~c1 | ~pr_B-> _y+
c1&n1&n2&sr_B -> _y-
_y => y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-4}; _y{-1}}
}
export defcell A_1C2N_SB_X4 (bool! y; bool? c1, n1, n2, pr, sr; bool vdd, vss)
{
bool _y;
prs{
~c1 & ~sr-> _y+
c1&n1&n2 | pr -> _y-
_y => y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-4}; _y{-1}}
}
2022-06-15 17:58:34 +02:00
export defcell A_2C1N_SB_X4 (bool! y; bool? c1, c2, n1, pr, sr; bool vdd, vss)
{
bool _y;
prs{
~c1 & ~c2 & ~sr-> _y+
c1&c2&n1 | pr -> _y-
_y => y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-4}; _y{-1}}
}
2022-04-01 16:57:44 +02:00
export defcell A_1C2P1N_X1 (bool! y; bool? c1, p1, p2, n1; bool vdd, vss)
{
prs{
~p1 & ~p2 & ~c1 -> y+
c1 & n1 -> y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
export defcell A_1C2P_B_X1 (bool! y; bool? c1, p1, p2; bool vdd, vss)
{
bool _y;
prs{
~p1 & ~p2 & ~c1 -> _y-
c1 -> _y+
_y => y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1} }
}
export defcell A_1C2P_X1 (bool! y; bool? c1, p1, p2; bool vdd, vss)
{
prs{
~p1 & ~p2 & ~c1 -> y+
c1 -> y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
export defcell A_1C3P2P2N_R_X1 (bool! y; bool? c1, p1, p2, p3, p4, p5, n1, n2, pr_B, sr_B; bool vdd, vss)
{
prs{
(~p1 & ~p2 & ~p3 & ~c1)|(~p4&~p5&~c1)|~pr_B -> y+
c1 & n1 & n2 & sr_B -> y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
2022-04-12 14:18:06 +02:00
export defcell A_2C2N2N_RB_X1 (bool ! y; bool? c1, c2, na1, na2, nb1, nb2, pr_B, sr_B; bool vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2) | ~pr_B -> _y+
2022-04-12 14:18:06 +02:00
c1 & c2 & ((na1 & na2) | (nb1 & nb2)) & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}}
}
export defcell A_2C2N2N_RB_X2 (bool ! y; bool? c1, c2, n1, n2, n3, n4, pr_B, sr_B; bool vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & ((n1 & n2) | (n3 & n4)) & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-2}; _y{-1}}
}
export defcell A_2C2N2N_RB_X4 (bool ! y; bool? c1, c2, n1, n2, n3, n4, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & ((n1 & n2) | (n3 & n4)) & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-4}; _y{-1}}
}
export defcell A_2C2N2N_R_X1 (bool ! y; bool? c1, c2, n1, n2, n3, n4, pr_B, sr_B; bool? vdd, vss)
{
prs{
(~c1 & ~c2) | ~pr_B -> y+
c1 & c2 & ((n1 & n2) | (n3 & n4)) & sr_B -> y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
2022-02-23 18:39:28 +01:00
export defcell A_2C2N_RB_X1 (bool ! y; bool? c1, c2, n1, n2, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
2022-02-23 18:39:28 +01:00
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & n1 & n2 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}}
}
2022-02-23 18:39:28 +01:00
export defcell A_2C2N_RB_X2 (bool ! y; bool? c1, c2, n1, n2, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
2022-02-23 18:39:28 +01:00
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & n1 & n2 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-2}; _y{-1}}
}
2022-02-23 18:39:28 +01:00
export defcell A_2C2N_RB_X4 (bool ! y; bool? c1, c2, n1, n2, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
2022-02-23 18:39:28 +01:00
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & n1 & n2 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-4}; _y{-1}}
}
2022-02-23 18:39:28 +01:00
export defcell A_2C2N_R_X1 (bool ! y; bool? c1, c2, n1, n2, pr_B, sr_B; bool? vdd, vss)
{
prs{
2022-02-23 18:39:28 +01:00
(~c1 & ~c2) | ~pr_B -> y+
c1 & c2 & n1 & n2 & sr_B -> y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
export defcell A_2C_B_X1 (bool ! y; bool? c1, c2; bool? vdd, vss)
{
bool _y;
prs{
~c1 & ~c2 -> _y+
c1 & c2 -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}}
}
export defcell A_2C_RB_X1 (bool ! y; bool? c1, c2, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}}
}
2022-02-23 18:33:36 +01:00
export defcell A_2C_RB_X4 (bool ! y; bool? c1, c2, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-4}; _y{-1}}
}
export defcell A_2C_R_X1 (bool ! y; bool? c1, c2, pr_B, sr_B; bool? vdd, vss)
{
prs{
(~c1 & ~c2) | ~pr_B -> y+
c1 & c2 & sr_B -> y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
2022-02-22 18:04:21 +01:00
export defcell A_2C1N_RB_X1(bool ! y; bool? c1, c2, n1, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & n1 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}}
}
2022-04-01 16:57:44 +02:00
export defcell A_2C1N_R_X1(bool ! y; bool? c1, c2, n1, pr_B, sr_B; bool? vdd, vss)
{
prs{
(~c1 & ~c2) | ~pr_B -> y+
c1 & c2 & n1 & sr_B -> y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
2022-02-22 18:04:21 +01:00
export defcell A_2C1N_RB_X4(bool ! y; bool? c1, c2, n1, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2) | ~pr_B -> _y+
c1 & c2 & n1 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-4}; _y{-1}}
}
export defcell A_2C_X1 (bool ! y; bool? c1, c2; bool? vdd, vss)
{
prs{
~c1 & ~c2 -> y+
c1 & c2 -> y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
2022-02-21 16:44:08 +01:00
export defcell A_3C_B_X1 (bool ! y; bool? c1, c2, c3; bool? vdd, vss)
{
bool _y;
prs{
~c1 & ~c2 & ~c3 -> _y+
c1 & c2 & c3 -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}}
}
export defcell A_3C_RB_X1 (bool ! y; bool? c1, c2, c3, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2 & ~c3) | ~pr_B -> _y+
c1 & c2 & c3 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}}
}
export defcell A_3C_RB_X2 (bool ! y; bool? c1, c2, c3, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2 & ~c3) | ~pr_B -> _y+
c1 & c2 & c3 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-2}; _y{-1}}
}
export defcell A_3C_RB_X4 (bool ! y; bool? c1, c2, c3, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2 & ~c3) | ~pr_B -> _y+
c1 & c2 & c3 & sr_B -> _y-
_y => y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-4}; _y{-1}}
}
export defcell A_3C_R_X1 (bool ! y; bool? c1, c2, c3, pr_B, sr_B; bool? vdd, vss)
{
prs{
(~c1 & ~c2 & ~c3) | ~pr_B -> y+
c1 & c2 & c3 & sr_B -> y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
export defcell A_3C_X1 (bool ! y; bool? c1, c2, c3; bool? vdd, vss)
{
prs{
~c1 & ~c2 & ~c3 -> y+
c1 & c2 & c3 -> y-
}
sizing {
leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
2022-02-21 10:28:19 +01:00
export defcell A_4C_RB_X1 (bool! y; bool? c1, c2, c3, c4, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2 & ~c3 & ~c4) | ~pr_B -> _y+
c1 & c2 & c3 & c4 & sr_B-> _y-
_y => y-
}
sizing { leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1}}
}
2022-02-21 10:28:19 +01:00
export defcell A_4C_RB_X2 (bool! y; bool? c1, c2, c3, c4, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2 & ~c3 & ~c4) | ~pr_B -> _y+
c1 & c2 & c3 & c4 & sr_B-> _y-
_y => y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-2}; _y{-1}}
}
2022-02-21 10:28:19 +01:00
export defcell A_4C_RB_X4 (bool! y; bool? c1, c2, c3, c4, pr_B, sr_B; bool? vdd, vss)
{
bool _y;
prs{
(~c1 & ~c2 & ~c3 & ~c4) | ~pr_B -> _y+
c1 & c2 & c3 & c4 & sr_B-> _y-
_y => y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-4}; _y{-1}}
}
2022-02-21 10:28:19 +01:00
export defcell A_4C_R_X1 (bool! y; bool? c1, c2, c3, c4, pr_B, sr_B; bool? vdd, vss)
{
prs{
(~c1 & ~c2 & ~c3 & ~c4) | ~pr_B -> y+
c1 & c2 & c3 & c4 & sr_B-> y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
export defcell A_4P1N1N_B_X1 (bool! y; bool? n1, n2, p1, p2, p3, p4; bool? vdd, vss)
{
bool _y;
prs{
~p1 & ~p2 & ~p3 & ~p4 -> _y+
n1 | n2 -> _y-
_y => y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1} }
}
2022-04-12 17:05:21 +02:00
export defcell A_4P1N1N_X1 (bool! y; bool? na1, nb1, p1, p2, p3, p4; bool? vdd, vss)
{
prs{
~p1 & ~p2 & ~p3 & ~p4 -> y+
2022-04-12 17:05:21 +02:00
na1 | nb1 -> y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}}
}
2022-02-23 19:01:54 +01:00
//Rajit example
defproc arbiter_Rajit (bool a, b, u, v)
2022-02-23 15:30:01 +01:00
{
bool _u, _v;
prs {
2022-02-23 19:01:54 +01:00
[keeper=0] a & _v -> _u-
[keeper=0] ~a | ~_v -> _u+
[keeper=0] b & _u -> _v-
[keeper=0] ~b | ~_u -> _v+
[keeper=0] _u => u-
[keeper=0] _v => v-
2022-02-23 15:30:01 +01:00
}
spec {
mk_excllo(_u, _v)
}
}
2022-02-23 19:01:54 +01:00
defproc ARBITER (bool? a, b, c, d; bool! y1,y2; bool? vdd, vss)
{
bool _y1, _y2;
prs {
[keeper=0] a & _y2 -> _y1-
[keeper=0] ~a | ~_y2 -> _y1+
[keeper=0] b & _y1 -> _y2-
[keeper=0] ~b | ~_y1 -> _y2+
[keeper=0] _y1 | c => y1-
[keeper=0] _y2 | d => y2-
2022-02-23 19:01:54 +01:00
}
spec {
mk_excllo(_y1, _y2)
2022-02-23 19:01:54 +01:00
}
}
2022-03-31 11:23:51 +02:00
export
2022-04-12 10:34:00 +02:00
defproc A_1N_U_X4(bool? n1; bool! y; bool? vdd, vss)
2022-03-04 12:33:49 +01:00
{
prs{
2022-04-12 10:34:00 +02:00
[keeper=0] n1 -> y-
2022-03-04 12:33:49 +01:00
}
}
2022-03-30 15:16:15 +02:00
2022-03-31 11:23:51 +02:00
export
2022-04-11 19:28:05 +02:00
defproc A_2N_U_X4(bool? n1, n2; bool! y; bool? vdd, vss)
2022-03-30 15:16:15 +02:00
{
prs{
2022-04-11 19:28:05 +02:00
[keeper=0] n1 & n2 -> y-
2022-03-30 15:16:15 +02:00
}
}
2022-03-04 12:33:49 +01:00
2022-03-31 11:23:51 +02:00
export
2022-04-12 10:24:39 +02:00
defproc A_1P_U_X4(bool? p1; bool! y; bool? vdd, vss)
2022-03-04 12:33:49 +01:00
{
prs{
2022-04-12 10:24:39 +02:00
[keeper=0] ~p1 -> y+
2022-03-04 12:33:49 +01:00
}
}
export
2022-04-11 19:28:05 +02:00
defproc A_2P_U_X4(bool? p1, p2; bool! y; bool? vdd, vss)
{
prs{
2022-04-11 19:28:05 +02:00
[keeper=0] ~p1 & ~p2 -> y+
}
}
2022-04-10 19:01:51 +02:00
export
2022-04-12 10:34:00 +02:00
defproc A_3P_U_X4(bool? p1, p2, p3; bool! y; bool? vdd, vss)
2022-04-10 19:01:51 +02:00
{
prs{
2022-04-12 10:34:00 +02:00
[keeper=0] ~p1 & ~p2 & ~p3-> y+
2022-04-10 19:01:51 +02:00
}
}
export
defproc PULLDOWN_X4(bool? a; bool! y; bool? vdd, vss) {
2022-04-12 10:34:00 +02:00
A_1N_U_X4 cell(.n1 = a, .y = y, .vdd = vdd, .vss = vss);
}
export
defproc PULLUP_X4(bool? a; bool! y; bool? vdd, vss) {
2022-04-12 10:34:00 +02:00
A_1P_U_X4 cell(.p1 = a, .y = y, .vdd = vdd, .vss = vss);
}
2022-03-04 19:04:11 +01:00
defproc A_2C2P_RB_X1(bool! y;bool? c1,c2,p1,p2,reset_B,vdd,vss){
bool _y;
prs{
(~p1 & ~p2 & ~c1 & ~c2)|~reset_B -> _y+
(c1 & c2 & reset_B) -> _y-
_y => y-
}
sizing {leak_adjust <- 1;
p_n_mode <- 1;
y {-1}; _y{-1} }
2022-03-04 12:33:49 +01:00
}
}}