├── .circleci └── config.yml ├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── build ├── check_filesystem.sh ├── check_omp.sh ├── clean ├── crosstest ├── 0 │ ├── expr.act │ ├── out2.act │ ├── run.sh │ ├── test2.act │ └── x.act ├── 1 │ ├── run.sh │ └── test.act ├── Makefile └── run.sh ├── extra ├── Galois ├── Galois2 ├── Galois3 ├── Galois4 └── Galois5 ├── gen_output.sh └── run.sh /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | jobs: 4 | ubuntu: 5 | docker: 6 | - image: ubuntu 7 | steps: 8 | - checkout 9 | - run: | 10 | echo "Hello" 11 | apt-get -q update -y 12 | DEBIAN_FRONTEND=noninteractive apt-get -q install -y libedit-dev zlib1g-dev m4 build-essential cmake libfmt-dev git cmake libboost-all-dev libopenmpi-dev llvm flex bison 13 | git clone https://github.com/asyncvlsi/actflow 14 | cd actflow 15 | git submodule update --init --recursive 16 | mkdir /usr/local/cad 17 | export ACT_HOME=/usr/local/cad 18 | ./build && ./run.sh 19 | 20 | alpine: 21 | docker: 22 | - image: alpine:latest 23 | steps: 24 | - checkout 25 | - run: | 26 | apk update 27 | apk add libedit-dev zlib-dev m4 make cmake fmt-dev git boost-dev openmpi-dev llvm flex bison gcc g++ patch numactl-dev 28 | git clone https://github.com/asyncvlsi/actflow 29 | cd actflow 30 | git submodule update --init --recursive 31 | mkdir /usr/local/cad 32 | export ACT_HOME=/usr/local/cad 33 | ./build && ./run.sh 34 | 35 | workflows: 36 | version: 2 37 | build: 38 | jobs: 39 | - ubuntu 40 | - alpine 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | patched 2 | CXX_COMPILER 3 | logs 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "act"] 2 | path = act 3 | url = http://github.com/asyncvlsi/act 4 | branch = master 5 | [submodule "phyDB"] 6 | path = phyDB 7 | url = http://github.com/asyncvlsi/phyDB 8 | branch = main 9 | [submodule "Dali"] 10 | path = Dali 11 | url = http://github.com/asyncvlsi/Dali 12 | branch = main 13 | [submodule "BiPart"] 14 | path = BiPart 15 | url = http://github.com/asyncvlsi/BiPart 16 | branch = main 17 | [submodule "SPRoute"] 18 | path = SPRoute 19 | url = http://github.com/asyncvlsi/SPRoute 20 | branch = master 21 | [submodule "PWRoute"] 22 | path = PWRoute 23 | url = http://github.com/asyncvlsi/PWRoute 24 | branch = master 25 | [submodule "interact"] 26 | path = interact 27 | url = http://github.com/asyncvlsi/interact 28 | branch = main 29 | [submodule "Galois"] 30 | path = Galois 31 | url = https://github.com/IntelligentSoftwareSystems/Galois 32 | branch = master 33 | [submodule "lefdef"] 34 | path = lefdef 35 | url = https://github.com/asyncvlsi/lefdef 36 | branch = main 37 | [submodule "TritonRoute-WXL"] 38 | path = TritonRoute-WXL 39 | url = https://github.com/asyncvlsi/TritonRoute-WXL 40 | branch = master 41 | [submodule "stdlib"] 42 | path = stdlib 43 | url = http://github.com/asyncvlsi/stdlib 44 | branch = main 45 | [submodule "chp2prs"] 46 | path = chp2prs 47 | url = https://github.com/asyncvlsi/chp2prs 48 | branch = master 49 | [submodule "dflowmap"] 50 | path = dflowmap 51 | url = https://github.com/asyncvlsi/dflowmap 52 | branch = main 53 | [submodule "expropt"] 54 | path = expropt 55 | url = https://github.com/asyncvlsi/expropt 56 | branch = main 57 | [submodule "actsim"] 58 | path = actsim 59 | url = https://github.com/asyncvlsi/actsim 60 | branch = master 61 | [submodule "layout"] 62 | path = layout 63 | url = https://github.com/asyncvlsi/layout 64 | branch = master 65 | [submodule "prs2fpga"] 66 | path = prs2fpga 67 | url = https://github.com/asyncvlsi/prs2fpga 68 | [submodule "xcell"] 69 | path = xcell 70 | url = https://github.com/asyncvlsi/xcell 71 | [submodule "dflow2dot"] 72 | path = dflow2dot 73 | url = https://github.com/asyncvlsi/dflow2dot 74 | [submodule "sky130l"] 75 | path = sky130l 76 | url = https://github.com/asyncvlsi/sky130l 77 | [submodule "utils"] 78 | path = utils 79 | url = https://github.com/asyncvlsi/utils 80 | [submodule "annotate"] 81 | path = annotate 82 | url = https://github.com/asyncvlsi/annotate 83 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The ACT flow for implementing asynchronous logic 2 | 3 | [![CircleCI](https://dl.circleci.com/status-badge/img/gh/asyncvlsi/actflow/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/asyncvlsi/actflow/tree/main) 4 | 5 | This repository contains the key modules required to use the ACT implementation flow for asynchronous logic. 6 | The parallel algorithms used in the implemention flow use a combination of OpenMP and the [Galois](https://github.com/IntelligentSoftwareSystems/Galois) 7 | library. 8 | 9 | 10 | ## Dependencies 11 | 12 | The Galois library depends on the following: 13 | 14 | * A modern C++ compiler compliant with the C++-17 standard (gcc >= 7, Intel >= 19.0.1, clang >= 7.0) 15 | * CMake (>= 3.16) 16 | * Boost library (>= 1.71.0, we recommend building/installing the full library) 17 | * libfmt (>= 4.0) 18 | 19 | More details about optional features/etc. are [available](https://github.com/IntelligentSoftwareSystems/Galois). 20 | Note that while the Galois library does depend on the LLVM compiler infrastructure, we are only using a small part 21 | of the library so we have eliminated this dependency for actflow. 22 | 23 | The ACT library depends on the following: 24 | 25 | * The system must have libedit installed. For the yum package manager, the package is called libedit-devel; for apt-get, it is libeditline-dev. Some systems have both packages. In that case please use libedit, not libeditline. 26 | * The system should have zlib installed 27 | * The system should have the macro pre-processing package m4 installed 28 | 29 | The expression optimization library uses the [abc](https://people.eecs.berkeley.edu/~alanmi/abc/) logic synthesis and verification library from Berkeley. 30 | It can also use [yosys](https://github.com/YosysHQ/yosys), if the binary 31 | is installed on your system. 32 | The README provided by yosys has detailed installation instructions. 33 | 34 | Your system may have an older version of the Boost libraries installed. 35 | If you cannot update those and need to install a more modern version of 36 | Boost in a different directory, then you can point the build process to 37 | your new Boost library location by setting the `BOOST_ROOT` environment 38 | variable to the new install directory. 39 | 40 | ## Steps 41 | 42 | 1. Pick an installation directory for all the tools, and set the environment variable `ACT_HOME` to this directory. Create this directory. 43 | 44 | 2. Make sure you have all the submodules needed as well (`git submodule update --init --recursive`), if you didn't clone the repo with all the submodules. 45 | 46 | 3. Run `./build` 47 | 48 | This should build and install all the libraries and tools needed. 49 | 50 | If you'd like to delete all the files generated during the build process, run `./clean` 51 | 52 | ## References 53 | 54 | If you use this flow for a publication, we would appreciate a citation to the following overview paper that summarizes the flow: 55 | 56 | * Samira Ataei, Wenmian Hua, Yihang Yang, Rajit Manohar, Yi-Shan Lu, Jiayuan He, Sepideh Maleki, Keshav Pingali, "An Open-Source EDA Flow for Asynchronous Logic," in IEEE Design & Test, vol. 38, no. 2, pp. 27-37, April 2021, doi: 10.1109/MDAT.2021.3051334. 57 | -------------------------------------------------------------------------------- /build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Starting: `date`" 4 | 5 | if [ x$ACT_HOME = x ] 6 | then 7 | echo "Please set the environment variable ACT_HOME to the install directory" 8 | exit 1 9 | fi 10 | 11 | if [ ! -d $ACT_HOME ] 12 | then 13 | echo "ACT_HOME directory [$ACT_HOME] not found?" 14 | exit 1 15 | fi 16 | 17 | if [ ! -w $ACT_HOME ] 18 | then 19 | echo 20 | echo "WARNING: ACT_HOME directory [$ACT_HOME] is not writeable; I hope that is okay!" 21 | echo 22 | fi 23 | 24 | if [ -f CXX_COMPILER ] 25 | then 26 | rm CXX_COMPILER 27 | fi 28 | if [ -f CXX_LIBFS ] 29 | then 30 | rm CXX_LIBFS 31 | fi 32 | ./check_omp.sh || exit 1 33 | ./check_filesystem.sh || exit 1 34 | 35 | cxx_compiler=`cat CXX_COMPILER` 36 | 37 | needlib="" 38 | needmake="" 39 | 40 | if [ -f CXX_LIBFS ] 41 | then 42 | needlib="-DNEED_LIBCXXFS=1" 43 | needmake="NEED_LIBCXXFS=1" 44 | fi 45 | 46 | # 47 | # Shell re-direct idiom used 48 | # 49 | # ((((command; echo $? >&3) | pipeline >&4) 3>&1) | (read res; exit $res)) 4>&1 50 | # 51 | # 1. Run command and capture its exit status on file descriptor (fd) 3 52 | # 2. Redirect stdout to fd 4 53 | # 3. Redirect fd 3 (the exit code) to stdout 54 | # 4. Read the exit code from stdin (pipeline), and re-exit 55 | # 5. Redirect fd 4 to stdout to restore it 56 | # 57 | 58 | cmake_build() { 59 | dir=$1 60 | shift 61 | echo 62 | echo "#### Building and installing package: $dir ####" 63 | date 64 | echo 65 | ((((cd $dir; if [ -x ./configure ]; then ./configure; fi; if [ ! -d build ]; then mkdir build; fi; cd build; cmake -DCMAKE_INSTALL_PREFIX=$ACT_HOME -DCMAKE_CXX_COMPILER=$cxx_compiler $needlib $@ .. && make -j 4 && make install; echo $? >&3) 2>logs/${dir}.err | ./gen_output.sh logs/${dir}.log 10 >&4) 3>&1) | (read res; exit $res)) 4>&1 66 | if [ $? -ne 0 ] 67 | then 68 | echo "FAILED" 69 | exit 1 70 | fi 71 | } 72 | 73 | cmake_build_bipart() { 74 | dir=BiPart 75 | echo 76 | echo "#### Building and installing package: Bipart ####" 77 | date 78 | echo 79 | (cd BiPart; if [ ! -d build ]; then mkdir build; fi; cd build; LEF_ROOT=$ACT_HOME GALOIS_INCLUDE=$ACT_HOME/include GALOIS_LIB=$ACT_HOME/lib DEF_ROOT=$ACT_HOME cmake -DCMAKE_INSTALL_PREFIX=$ACT_HOME -DCMAKE_CXX_COMPILER=$cxx_compiler $needlib .. && make -j 4 && make install) || exit 1 80 | } 81 | 82 | act_tool_build() { 83 | if [ $# -eq 1 ] 84 | then 85 | thresh=10 86 | else 87 | thresh=$2 88 | fi 89 | dir=$1 90 | echo 91 | echo "#### Building and installing package: $1 ####" 92 | date 93 | echo 94 | ((((cd $dir; if [ -x ./configure ]; then ./configure; fi; if [ -x ./build.sh ]; then ./build.sh CXX=$cxx_compiler $needmake; else make CXX=$cxx_compiler $needmake depend && make CXX=$cxx_compiler $needmake && make install; fi; echo $? >&3) 2>logs/${dir}.err | ./gen_output.sh logs/${dir}.log $thresh >&4) 3>&1) | (read res; exit $res)) 4>&1 95 | if [ $? -ne 0 ] 96 | then 97 | echo "FAILED" 98 | exit 1 99 | fi 100 | } 101 | 102 | # 103 | # Apply patches 104 | # 105 | echo "Applying patch to Galois library..." 106 | if [ ! -f patched ] 107 | then 108 | (cd Galois; 109 | patch -p0 < ../extra/Galois; 110 | patch -p0 < ../extra/Galois2; 111 | patch -p0 < ../extra/Galois3; 112 | patch -p0 < ../extra/Galois4; 113 | patch -p0 < ../extra/Galois5 114 | ) 115 | touch patched 116 | fi 117 | 118 | # 119 | # Create directory to hold build logs 120 | # 121 | if [ ! -d logs ] 122 | then 123 | mkdir logs 124 | fi 125 | 126 | echo "Log files and errors can be found in the logs/ directory." 127 | echo "Each number displayed corresponds to 10 lines in the output log file." 128 | echo 129 | echo "Starting: `date`" 130 | 131 | # 132 | # Build and install the ACT library 133 | # 134 | echo 135 | echo "#### Building and installing the core ACT library ####" 136 | echo 137 | export VLSI_TOOLS_SRC=`pwd`/act 138 | ((((cd act; ./configure $ACT_HOME CXX=$cxx_compiler; ./build; make install; echo $? >&3) 2> logs/act.err | ./gen_output.sh logs/act.log >&4) 3>&1) | (read res; exit $res)) 4>&1 139 | if [ $? -ne 0 ] 140 | then 141 | echo "FAILED"; exit $? 142 | fi 143 | 144 | # 145 | # Build and install the Galois library 146 | # 147 | cmake_build Galois 2>logs/Galois.err 148 | if [ -f $ACT_HOME/lib64/libgalois_shmem.a -a ! -f $ACT_HOME/lib/libgalois_shmem.a ] 149 | then 150 | ln -s $ACT_HOME/lib64/libgalois_shmem.a $ACT_HOME/lib/libgalois_shmem.a 151 | fi 152 | 153 | # 154 | # Build and install the LEF/DEF library 155 | # 156 | echo 157 | echo "#### Building and installing the LEF/DEF parser ####" 158 | echo 159 | (cd lefdef; make && make install) 2>logs/lefdef.err | ./gen_output.sh logs/lefdef.log || exit 1 160 | 161 | # Build and install the SDF/SPEF library 162 | act_tool_build annotate 163 | 164 | # 165 | # Build and install... 166 | # 167 | 168 | # galois timer library 169 | if [ -f timing/actpin.h ] 170 | then 171 | (cd timing; ./build_galois.sh) 2>logs/timing0.err | ./gen_output.sh logs/timing0.log || exit 1 172 | fi 173 | 174 | # phyDB 175 | cmake_build phyDB 176 | 177 | # 178 | # Build and install the timing library, if it exists 179 | # 180 | if [ -f timing/actpin.h ] 181 | then 182 | act_tool_build timing 183 | fi 184 | 185 | # layout 186 | act_tool_build layout 187 | 188 | # BiPart 189 | ((((cmake_build_bipart; echo $? >&3) 2>logs/bipart.err | ./gen_output.sh logs/bipart.log >&4) 3>&1) | (read res; exit $res)) 4>&1 190 | if [ $? -ne 0 ] 191 | then 192 | echo "FAILED" 193 | exit 1 194 | fi 195 | 196 | # Dali 197 | cmake_build Dali 198 | 199 | # PWRoute 200 | cmake_build PWRoute 201 | 202 | # SPRoute 203 | cmake_build SPRoute 204 | 205 | # TritonRoute-WXL 206 | cmake_build TritonRoute-WXL 207 | 208 | # interact 209 | act_tool_build interact 210 | 211 | # stdlib 212 | act_tool_build stdlib 213 | 214 | # expropt 215 | act_tool_build expropt 50 216 | 217 | # expropt_commercial 218 | if [ -f expropt_commercial/Makefile ] 219 | then 220 | act_tool_build expropt_commercial 221 | fi 222 | 223 | # 224 | # chp2prs 225 | act_tool_build chp2prs 226 | 227 | # 228 | # dflowmap 229 | cmake_build dflowmap 230 | 231 | # 232 | # dflowmap_netlist, if it exists 233 | # 234 | if [ -f dflowmap_netlist/build.sh ] 235 | then 236 | cmake_build dflowmap_netlist 237 | cmake_build dflowmap 238 | fi 239 | 240 | 241 | # 242 | # prs2fpga 243 | act_tool_build prs2fpga 244 | 245 | # 246 | # xcell 247 | act_tool_build xcell 248 | 249 | # 250 | # dflow2dot 251 | act_tool_build dflow2dot 252 | 253 | # 254 | # sky130l 255 | act_tool_build sky130l 256 | 257 | # 258 | # utils 259 | act_tool_build utils 260 | 261 | # actsim 262 | act_tool_build actsim 263 | 264 | echo 265 | echo "Finished: `date`" 266 | -------------------------------------------------------------------------------- /check_filesystem.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Check for c++, g++, clang++ on the system 4 | # 5 | # 6 | 7 | compiler=`cat CXX_COMPILER` 8 | 9 | cat > _tst.cc < 11 | 12 | int main (void) 13 | { 14 | std::filesystem::path tst {".."}; 15 | return 0; 16 | } 17 | EOM 18 | res=0 19 | $compiler -std=c++17 _tst.cc >/dev/null 2>&1 || res=1 20 | rm -f _tst.o a.out 21 | if [ $res -ne 0 ] 22 | then 23 | res=0 24 | $compiler -std=c++17 _tst.cc -lstdc++fs >/dev/tty 2>&1 || res=1 25 | if [ $res -ne 0 ] 26 | then 27 | echo "C++ compiler does not directly support std::filesystem." 28 | echo "Please set environment variable CXX to a C++ compiler that does." 29 | rm -f _tst.cc _tst.o a.out 30 | exit 1 31 | else 32 | echo "C++ compiler requires -lstdc++fs for std::filesystem" 33 | touch CXX_LIBFS 34 | fi 35 | fi 36 | 37 | rm -f _tst.cc _tst.o a.out 38 | exit 0 39 | -------------------------------------------------------------------------------- /check_omp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Check for c++, g++, clang++ on the system 4 | # 5 | # 6 | 7 | final=none 8 | 9 | clist="c++ g++ clang++" 10 | 11 | for compiler in $clist $CXX 12 | do 13 | cat > _tst.cc < 15 | 16 | int main (void) 17 | { 18 | return 0; 19 | } 20 | EOM 21 | res=0 22 | $compiler -fopenmp -c _tst.cc >/dev/null 2>&1 || res=1 23 | if [ $res -eq 0 ] 24 | then 25 | final=$compiler 26 | fi 27 | done 28 | 29 | rm -f _tst.cc _tst.o 30 | 31 | if [ "$final" = "none" ] 32 | then 33 | echo "Could not find a C++ compiler that supports -fopenmp" 34 | echo "Please set environment variable CXX to a C++ compiler that does." 35 | echo "Note: modern LLVM and GNU compilers support this option; if you" 36 | echo "are on a Mac, installing LLVM using homebrew (brew install llvm)" 37 | echo "and setting CXX to be the path to the resulting clang++ should work." 38 | rm -f CXX_COMPILER 39 | exit 1 40 | fi 41 | 42 | echo $final > CXX_COMPILER 43 | 44 | exit 0 45 | -------------------------------------------------------------------------------- /clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | echo "Cleaning all directories..." 5 | 6 | echo "*** act ***" 7 | (cd act; make realclean) 8 | 9 | echo "*** lefdef ***" 10 | (cd lefdef; make clean) 11 | 12 | for i in Galois phyDB BiPart Dali PWRoute SPRoute TritonRoute-WXL dflowmap 13 | do 14 | echo "*** $i ***" 15 | (cd $i && rm -rf build) 16 | done 17 | 18 | echo "*** abc ***" 19 | (cd expropt/abc && make clean ABC_MAKE_NO_DEPS=1) 20 | (cd expropt/abc2 && make clean ABC_MAKE_NO_DEPS=1) 21 | 22 | for i in annotate interact layout expropt chp2prs prs2fpga xcell dflow2dot actsim actsim/tracelib 23 | do 24 | echo "*** $i ***" 25 | (cd $i; make realclean) 26 | done 27 | 28 | if [ -f timing/actpin.h ] 29 | then 30 | echo "*** timing ***" 31 | (cd timing/cyclone && rm -rf build) 32 | (cd timing/galois_eda && rm -rf build) 33 | fi 34 | 35 | if [ -f dflowmap_netlist/build.sh ] 36 | then 37 | echo "*** dflowmap_netlist ***" 38 | (cd dflowmap_netlist && rm -rf build) 39 | fi 40 | 41 | if [ -f expropt_commercial/Makefile ] 42 | then 43 | echo "*** expropt_commercial ***" 44 | (cd expropt_commercial; make realclean) 45 | fi 46 | -------------------------------------------------------------------------------- /crosstest/0/expr.act: -------------------------------------------------------------------------------- 1 | namespace syn { 2 | 3 | export namespace expr { 4 | 5 | /* -- declarations -- */ 6 | export defproc blk0 (bool? e1[2]; bool! out); 7 | 8 | export defproc blk0 (bool? e1[2]; bool! out) 9 | { 10 | spec { hazard(*) } 11 | 12 | /*--- types ---*/ 13 | syn::NOR2X1 _5_; 14 | bool _xtpa0[2]; 15 | bool _0_; 16 | bool _1_; 17 | syn::TIELOX1 _6_; 18 | bool _xtpa2; 19 | bool _4_; 20 | bool _2_; 21 | bool _xtpa1; 22 | bool _3_; 23 | /*--- connections ---*/ 24 | _5_(.A=_0_, .B=_1_, .Y=_2_); 25 | _6_(.Y=_3_); 26 | _xtpa0=e1; 27 | _xtpa1=_3_; 28 | _xtpa2=out; 29 | _0_=e1[0]; 30 | _1_=e1[1]; 31 | out=_2_; 32 | } 33 | 34 | /* -- declarations -- */ 35 | export defproc blk1 (bool? e6[2]; bool! out); 36 | 37 | export defproc blk1 (bool? e6[2]; bool! out) 38 | { 39 | spec { hazard(*) } 40 | 41 | /*--- types ---*/ 42 | bool _5_; 43 | bool _xtpa0[2]; 44 | bool _0_; 45 | bool _1_; 46 | bool _6_; 47 | bool _xtpa2; 48 | bool _4_; 49 | syn::TIEHIX1 _9_; 50 | bool _2_; 51 | bool _xtpa1; 52 | bool _3_; 53 | syn::INVX1 _7_; 54 | syn::NOR2X1 _8_; 55 | /*--- connections ---*/ 56 | _7_(.A=_0_, .Y=_2_); 57 | _8_(.A=_2_, .B=_1_, .Y=_3_); 58 | _9_(.Y=_4_); 59 | _xtpa0=e6; 60 | _xtpa1=_4_; 61 | _xtpa2=out; 62 | _0_=e6[0]; 63 | _1_=e6[1]; 64 | out=_3_; 65 | } 66 | 67 | /* -- declarations -- */ 68 | export defproc blk2 (bool? e11[2]; bool! out); 69 | 70 | export defproc blk2 (bool? e11[2]; bool! out) 71 | { 72 | spec { hazard(*) } 73 | 74 | /*--- types ---*/ 75 | bool _04_; 76 | bool _06_; 77 | bool _xtpa0[2]; 78 | bool _05_; 79 | syn::TIEHIX1 _10_; 80 | bool _03_; 81 | syn::TIELOX1 _11_; 82 | bool _xtpa2; 83 | syn::INVX1 _08_; 84 | bool _02_; 85 | bool _07_; 86 | bool _xtpa1[2]; 87 | syn::NOR2X1 _09_; 88 | bool _01_; 89 | bool _00_; 90 | /*--- connections ---*/ 91 | _08_(.A=_01_, .Y=_02_); 92 | _09_(.A=_02_, .B=_00_, .Y=_03_); 93 | _10_(.Y=_04_); 94 | _11_(.Y=_05_); 95 | _xtpa0=e11; 96 | _xtpa1[1]=_04_; 97 | _xtpa1[0]=_05_; 98 | _xtpa2=out; 99 | _01_=e11[1]; 100 | _00_=e11[0]; 101 | out=_03_; 102 | } 103 | 104 | /* -- declarations -- */ 105 | export defproc blk3 (bool? e16[2]; bool! out); 106 | 107 | export defproc blk3 (bool? e16[2]; bool! out) 108 | { 109 | spec { hazard(*) } 110 | 111 | /*--- types ---*/ 112 | bool _5_; 113 | bool _xtpa0[2]; 114 | bool _0_; 115 | bool _1_; 116 | bool _6_; 117 | bool _xtpa2; 118 | bool _4_; 119 | bool _2_; 120 | bool _xtpa1[2]; 121 | bool _3_; 122 | syn::AND2X1 _7_; 123 | syn::TIEHIX1 _8_; 124 | /*--- connections ---*/ 125 | _7_(.A=_0_, .B=_1_, .Y=_2_); 126 | _8_(.Y=_3_); 127 | _xtpa0=e16; 128 | _xtpa1[1]=_3_; 129 | _xtpa1[0]=_3_; 130 | _xtpa2=out; 131 | _0_=e16[0]; 132 | _1_=e16[1]; 133 | out=_2_; 134 | } 135 | 136 | /* -- declarations -- */ 137 | export defproc blk4 (bool? e21[3]; bool! out[3]); 138 | 139 | export defproc blk4 (bool? e21[3]; bool! out[3]) 140 | { 141 | spec { hazard(*) } 142 | 143 | /*--- types ---*/ 144 | bool _04_; 145 | bool _06_; 146 | syn::XOR2X1 _12_; 147 | bool _xtpa0[3]; 148 | bool _05_; 149 | syn::XNOR2X1 _13_; 150 | bool _xtpa4[4]; 151 | syn::INVX1 _10_; 152 | bool _03_; 153 | syn::NAND2X1 _11_; 154 | bool _xtpa2[4]; 155 | syn::TIELOX1 _15_; 156 | bool _08_; 157 | bool _02_; 158 | bool _07_[3]; 159 | bool _xtpa1; 160 | bool _xtpa3[4]; 161 | bool _09_; 162 | syn::TIEHIX1 _14_; 163 | bool _01_; 164 | bool _00_; 165 | /*--- connections ---*/ 166 | _10_(.A=_00_, .Y=_04_); 167 | _11_(.A=_00_, .B=_01_, .Y=_03_); 168 | _12_(.A=_00_, .B=_01_, .Y=_05_); 169 | _13_(.A=_02_, .B=_03_, .Y=_06_); 170 | _14_(.Y=_08_); 171 | _15_(.Y=_09_); 172 | _07_[0]=e21[0]; 173 | _xtpa0=e21; 174 | _xtpa1=_08_; 175 | _xtpa2[3]=_09_; 176 | _xtpa2[2]=e21[2]; 177 | _xtpa2[1]=e21[1]; 178 | _xtpa2[0]=e21[0]; 179 | _xtpa3[3]=_09_; 180 | _xtpa3[2]=_09_; 181 | _xtpa3[1]=_09_; 182 | _xtpa3[0]=_08_; 183 | _xtpa4[3]=GND; 184 | _xtpa4[2]=out[2]; 185 | _xtpa4[1]=out[1]; 186 | _xtpa4[0]=out[0]; 187 | _00_=e21[0]; 188 | out[0]=_04_; 189 | _01_=e21[1]; 190 | out[1]=_05_; 191 | _02_=e21[2]; 192 | out[2]=_06_; 193 | } 194 | 195 | /* -- declarations -- */ 196 | export defproc blk5 (bool? e25[3]; bool! out[3]); 197 | 198 | export defproc blk5 (bool? e25[3]; bool! out[3]) 199 | { 200 | spec { hazard(*) } 201 | 202 | /*--- types ---*/ 203 | bool _04_; 204 | bool _06_; 205 | syn::INVX1 _12_; 206 | bool _xtpa0[3]; 207 | bool _05_; 208 | syn::NOR2X1 _13_; 209 | bool _xtpa4[4]; 210 | bool _10_; 211 | bool _03_; 212 | bool _11_; 213 | bool _xtpa2[4]; 214 | syn::XOR2X1 _15_; 215 | bool _08_[3]; 216 | bool _02_; 217 | bool _07_[3]; 218 | bool _xtpa1; 219 | syn::TIEHIX1 _16_; 220 | syn::TIELOX1 _17_; 221 | bool _xtpa3[4]; 222 | bool _09_; 223 | syn::XNOR2X1 _14_; 224 | bool _01_; 225 | bool _00_; 226 | /*--- connections ---*/ 227 | _12_(.A=_00_, .Y=_04_); 228 | _13_(.A=_00_, .B=_01_, .Y=_03_); 229 | _14_(.A=_00_, .B=_01_, .Y=_05_); 230 | _15_(.A=_02_, .B=_03_, .Y=_06_); 231 | _16_(.Y=_09_); 232 | _17_(.Y=_10_); 233 | _07_[0]=e25[0]; 234 | _08_[0]=e25[0]; 235 | _xtpa0=e25; 236 | _xtpa1=_09_; 237 | _xtpa2[3]=_10_; 238 | _xtpa2[2]=e25[2]; 239 | _xtpa2[1]=e25[1]; 240 | _xtpa2[0]=e25[0]; 241 | _xtpa3[3]=_10_; 242 | _xtpa3[2]=_10_; 243 | _xtpa3[1]=_10_; 244 | _xtpa3[0]=_09_; 245 | _xtpa4[3]=GND; 246 | _xtpa4[2]=out[2]; 247 | _xtpa4[1]=out[1]; 248 | _xtpa4[0]=out[0]; 249 | _00_=e25[0]; 250 | out[0]=_04_; 251 | _01_=e25[1]; 252 | _02_=e25[2]; 253 | out[1]=_05_; 254 | out[2]=_06_; 255 | } 256 | 257 | /* -- declarations -- */ 258 | export defproc blk6 (bool! out[3]); 259 | 260 | export defproc blk6 (bool! out[3]) 261 | { 262 | spec { hazard(*) } 263 | 264 | /*--- types ---*/ 265 | bool _xtpa0; 266 | bool _0_; 267 | syn::TIELOX1 _1_; 268 | /*--- connections ---*/ 269 | _1_(.Y=_0_); 270 | _xtpa0=_0_; 271 | out[2]=_0_; 272 | out[1]=_0_; 273 | out[0]=_0_; 274 | } 275 | 276 | /* -- declarations -- */ 277 | export defproc blk7 (bool? e31[3]; bool out[3]); 278 | 279 | export defproc blk7 (bool? e31[3]; bool out[3]) 280 | { 281 | spec { hazard(*) } 282 | 283 | /*--- types ---*/ 284 | bool _xtpa0[3]; 285 | /*--- connections ---*/ 286 | _xtpa0=e31; 287 | out=e31; 288 | } 289 | 290 | 291 | } 292 | 293 | } 294 | -------------------------------------------------------------------------------- /crosstest/0/out2.act: -------------------------------------------------------------------------------- 1 | import "x.act"; 2 | import "syn/bdopt/_all_.act"; 3 | open syn; 4 | import "expr.act"; 5 | 6 | defproc sdt_counter_33_4 <: counter<3> () 7 | +{ 8 | syn::sdtvar<2> cv; 9 | syn::sdtvar<3> a; 10 | syn::sdtchan<3> O; 11 | syn::sdtchan<2> C; 12 | } 13 | { 14 | refine { 15 | syn::muxoutport<3,1> O_muxo(O); 16 | // { O.d[0] === O_muxo.m[0].d[0] : "check-1!" }; 17 | syn::var_int_ports<2,1,4> var_cv(cv); 18 | syn::muxinport<2,1> C_muxi(C); 19 | syn::var_int_ports<3,3,3> var_a(a); 20 | // { var_a.out[0].d[0] === var_a.v.d[0].t : "check-2" }; 21 | // { var_a.out[1].d[0] === var_a.v.d[0].t : "check-2" }; 22 | a1of1 c0; 23 | syn::trueto1of2 e0; 24 | a1of1 c1; 25 | a1of1 c2; 26 | syn::recvport<2,2> s_0(c2,C_muxi.m[0],var_cv.in[0]); 27 | a1of1 c3; 28 | syn::expr::nullint<2> e1(var_cv.out[0]); 29 | syn::expr::blk0 e2(e1.out.d); 30 | // wrap and ctl bypass 31 | syn::expr::null e3(); 32 | e3.out.d[0]=e2.out; 33 | e1.out.r = e3.out.r; 34 | std::gates::ctree<1,false> ackmerge3; 35 | /* delay: 1e-07 */ 36 | syn::delay<333> delayblk3 (ackmerge3.out, e3.out.a); 37 | e1.out.a = ackmerge3.in[0]; 38 | //end expr blk0 39 | syn::sdtvar<1> fvar0; 40 | syn::var_int_ports<1,1,1> var_fvar0(fvar0); 41 | a1of1 c4; 42 | syn::transfer<1> s_1(c4, e3.out,var_fvar0.in[0]); 43 | a1of1 c5; 44 | syn::fullseq s_2(c5,c4); 45 | syn::expr::nullint<1> e4(var_fvar0.out[0]); 46 | syn::bdto1of2 e5; 47 | e5.out.r = c5.r; c5.a = e4.out.r; e5.out.d=e4.out.d; e5.out.a=e4.out.a; 48 | syn::expr::nullint<2> e6(var_cv.out[1]); 49 | syn::expr::blk1 e7(e6.out.d); 50 | // wrap and ctl bypass 51 | syn::expr::null e8(); 52 | e8.out.d[0]=e7.out; 53 | e6.out.r = e8.out.r; 54 | std::gates::ctree<1,false> ackmerge8; 55 | /* delay: 1e-07 */ 56 | syn::delay<333> delayblk8 (ackmerge8.out, e8.out.a); 57 | e6.out.a = ackmerge8.in[0]; 58 | //end expr blk1 59 | syn::sdtvar<1> fvar1; 60 | syn::var_int_ports<1,1,1> var_fvar1(fvar1); 61 | a1of1 c6; 62 | syn::transfer<1> s_3(c6, e8.out,var_fvar1.in[0]); 63 | a1of1 c7; 64 | syn::fullseq s_4(c7,c6); 65 | syn::expr::nullint<1> e9(var_fvar1.out[0]); 66 | syn::bdto1of2 e10; 67 | e10.out.r = c7.r; c7.a = e9.out.r; e10.out.d=e9.out.d; e10.out.a=e9.out.a; 68 | syn::expr::nullint<2> e11(var_cv.out[2]); 69 | syn::expr::blk2 e12(e11.out.d); 70 | // wrap and ctl bypass 71 | syn::expr::null e13(); 72 | e13.out.d[0]=e12.out; 73 | e11.out.r = e13.out.r; 74 | std::gates::ctree<1,false> ackmerge13; 75 | /* delay: 1e-07 */ 76 | syn::delay<333> delayblk13 (ackmerge13.out, e13.out.a); 77 | e11.out.a = ackmerge13.in[0]; 78 | //end expr blk2 79 | syn::sdtvar<1> fvar2; 80 | syn::var_int_ports<1,1,1> var_fvar2(fvar2); 81 | a1of1 c8; 82 | syn::transfer<1> s_5(c8, e13.out,var_fvar2.in[0]); 83 | a1of1 c9; 84 | syn::fullseq s_6(c9,c8); 85 | syn::expr::nullint<1> e14(var_fvar2.out[0]); 86 | syn::bdto1of2 e15; 87 | e15.out.r = c9.r; c9.a = e14.out.r; e15.out.d=e14.out.d; e15.out.a=e14.out.a; 88 | syn::expr::nullint<2> e16(var_cv.out[3]); 89 | syn::expr::blk3 e17(e16.out.d); 90 | // wrap and ctl bypass 91 | syn::expr::null e18(); 92 | e18.out.d[0]=e17.out; 93 | e16.out.r = e18.out.r; 94 | std::gates::ctree<1,false> ackmerge18; 95 | /* delay: 1e-07 */ 96 | syn::delay<333> delayblk18 (ackmerge18.out, e18.out.a); 97 | e16.out.a = ackmerge18.in[0]; 98 | //end expr blk3 99 | syn::sdtvar<1> fvar3; 100 | syn::var_int_ports<1,1,1> var_fvar3(fvar3); 101 | a1of1 c10; 102 | syn::transfer<1> s_7(c10, e18.out,var_fvar3.in[0]); 103 | a1of1 c11; 104 | syn::fullseq s_8(c11,c10); 105 | syn::expr::nullint<1> e19(var_fvar3.out[0]); 106 | syn::bdto1of2 e20; 107 | e20.out.r = c11.r; c11.a = e19.out.r; e20.out.d=e19.out.d; e20.out.a=e19.out.a; 108 | a1of1 c12; 109 | syn::expr::nullint<3> e21(var_a.out[0]); 110 | syn::expr::blk4 e22(e21.out.d); 111 | // wrap and ctl bypass 112 | syn::expr::nullint<3> e23(); 113 | e23.out.d=e22.out; 114 | e21.out.r = e23.out.r; 115 | std::gates::ctree<1,false> ackmerge23; 116 | /* delay: 1e-07 */ 117 | syn::delay<333> delayblk23 (ackmerge23.out, e23.out.a); 118 | e21.out.a = ackmerge23.in[0]; 119 | //end expr blk4 120 | syn::sdtvar<3> fvar4; 121 | syn::var_int_ports<3,1,1> var_fvar4(fvar4); 122 | a1of1 c13; 123 | a1of1 c14; 124 | syn::fullseq s_9(c13,c14); 125 | syn::transfer<3> s_10(c14, e23.out,var_fvar4.in[0]); 126 | a1of1 c15; 127 | syn::expr::nullint<3> e24(var_fvar4.out[0]); 128 | syn::transfer<3> s_11(c15, e24.out,var_a.in[0]); 129 | syn::semi<2> s_12(c12,{c13,c15}); 130 | a1of1 c16; 131 | syn::expr::nullint<3> e25(var_a.out[1]); 132 | syn::expr::blk5 e26(e25.out.d); 133 | // wrap and ctl bypass 134 | syn::expr::nullint<3> e27(); 135 | e27.out.d=e26.out; 136 | e25.out.r = e27.out.r; 137 | std::gates::ctree<1,false> ackmerge27; 138 | /* delay: 1e-07 */ 139 | syn::delay<333> delayblk27 (ackmerge27.out, e27.out.a); 140 | e25.out.a = ackmerge27.in[0]; 141 | //end expr blk5 142 | syn::sdtvar<3> fvar5; 143 | syn::var_int_ports<3,1,1> var_fvar5(fvar5); 144 | a1of1 c17; 145 | a1of1 c18; 146 | syn::fullseq s_13(c17,c18); 147 | syn::transfer<3> s_14(c18, e27.out,var_fvar5.in[0]); 148 | a1of1 c19; 149 | syn::expr::nullint<3> e28(var_fvar5.out[0]); 150 | syn::transfer<3> s_15(c19, e28.out,var_a.in[1]); 151 | syn::semi<2> s_16(c16,{c17,c19}); 152 | a1of1 c20; 153 | syn::expr::blk6 e29(); 154 | // wrap and ctl bypass 155 | syn::expr::nullint<3> e30(); 156 | e30.out.d=e29.out; 157 | e30.out.a = e30.out.r; 158 | //end expr blk6 159 | syn::transfer<3> s_17(c20, e30.out,var_a.in[2]); 160 | a1of1 c21; 161 | syn::expr::nullint<3> e31(var_a.out[2]); 162 | // { var_a.out[2].d[0] === var_a.v.d[0].t : "check-2" }; 163 | // { e31.out.d[0] === var_a.v.d[0].t : "check-2" }; 164 | syn::expr::blk7 e32(e31.out.d); 165 | // { e32.out[0] === var_a.v.d[0].t : "check-2" }; 166 | // wrap and ctl bypass 167 | syn::expr::nullint<3> e33(); 168 | e33.out.d=e32.out; 169 | e31.out.r = e33.out.r; 170 | // { e33.out.d[0] === var_a.v.d[0].t : "check-2" }; 171 | std::gates::ctree<1,false> ackmerge33; 172 | /* delay: 1e-07 */ 173 | syn::delay<333> delayblk33 (ackmerge33.out, e33.out.a); 174 | e31.out.a = ackmerge33.in[0]; 175 | //end expr blk7 176 | 177 | 178 | /*---- this is connected here ----*/ 179 | 180 | // { e33.out.d[0] === var_a.v.d[0].t : "check-pre" }; 181 | 182 | 183 | /** if we comment this, it breaks! **/ 184 | // { O.d[0] === O_muxo.m[0].d[0] : "preHmm" }; 185 | 186 | // syn::transfer<3> s_18(c21, e33.out,O_muxo.m[0]); 187 | 188 | syn::transfer<3> s_18; 189 | // s_18.c = c21; 190 | ${ "------------------**********--------------" }; 191 | ${ "------------------**********--------------" }; 192 | ${ "------------------**********--------------" }; 193 | ${ "------------------**********--------------" }; 194 | s_18.e = e33.out; 195 | s_18.ch = O_muxo.m[0]; 196 | 197 | { e33.out.d[0] === var_a.v.d[0].t : "check-pre-1" }; 198 | // { e33.out.d[0] === var_a.v.d[0].t : "check-X3" }; 199 | 200 | 201 | /*-- what transfer does internally 202 | 203 | c21.r = e33.out.r; 204 | e33.out.a = O_muxo.m[0].r; 205 | e33.out.d = O_muxo.m[0].d; 206 | c21.a = O_muxo.m[0].a; 207 | 208 | --*/ 209 | 210 | /*---- but now is disconnected! ----*/ 211 | 212 | // { e33.out.d[0] === var_a.v.d[0].t : "check-X" }; 213 | 214 | 215 | // { e33.out.d[0] === O_muxo.m[0].d[0] : "Hmm" }; 216 | // { O.d[0] === O_muxo.m[0].d[0] : "Hmm2" }; 217 | syn::select<4,false> s_19(c3,{e5.out,e10.out,e15.out,e20.out},{c12,c16,c20,c21}); 218 | syn::semi<2> s_20(c1,{c2,c3}); 219 | syn::loop<1> s_21(c0,{e0.out},{c1}); 220 | /*--- connect reset to go signal ---*/ 221 | a1of1 c22; 222 | syn::sinit s22 (c0); 223 | { O.d[0] === var_a.v.d[0].t : "check!" }; 224 | } 225 | } 226 | 227 | -------------------------------------------------------------------------------- /crosstest/0/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | act-test -ref=1 -e test2.act || exit 1 4 | exit 0 5 | -------------------------------------------------------------------------------- /crosstest/0/test2.act: -------------------------------------------------------------------------------- 1 | import "out2.act"; 2 | 3 | sdt_counter_33_4 t; 4 | -------------------------------------------------------------------------------- /crosstest/0/x.act: -------------------------------------------------------------------------------- 1 | template 2 | defproc counter(chan?(int<2>) C; chan!(int) O) 3 | { 4 | int a; 5 | int<2> cv; 6 | chp { 7 | *[ C?cv; 8 | [cv=0->a:=a+1 9 | []cv=1-> a:= a-1 10 | []cv=2 -> a:=0 11 | []cv=3 -> O!a 12 | ] 13 | ] 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /crosstest/1/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | act-test -e test.act || exit 1 4 | -------------------------------------------------------------------------------- /crosstest/1/test.act: -------------------------------------------------------------------------------- 1 | export deftype globals <: int (bool Vdd, GND) { } 2 | 3 | export template deftype c1of <: int (bool d[N]) { } 4 | 5 | template defchan e1of <: chan(int) (c1of b; bool d[N]; bool e) { 6 | b.d = d; 7 | } 8 | 9 | export defproc wchb1(globals g; e1of<2> L, R) 10 | { 11 | c1of<1> _R; 12 | R.d[1] = g.GND; 13 | prs 14 | { 15 | [keeper=0] ~L.d[0] & ~_R.d[0] -> R.d[0]+ 16 | } 17 | } 18 | 19 | export defproc foo(globals g; e1of<2> L, R) 20 | { 21 | e1of<2> M; 22 | wchb1 buf1; 23 | buf1.g = g; 24 | buf1.R = M; 25 | { M.d[1] === g.GND }; 26 | } 27 | 28 | foo t; 29 | -------------------------------------------------------------------------------- /crosstest/Makefile: -------------------------------------------------------------------------------- 1 | runtest: 2 | @./run.sh 3 | -------------------------------------------------------------------------------- /crosstest/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo 4 | echo "************************************************************************" 5 | echo "* Testing across tools *" 6 | echo "************************************************************************" 7 | echo 8 | 9 | check_echo=0 10 | myecho() 11 | { 12 | if [ $check_echo -eq 0 ] 13 | then 14 | check_echo=1 15 | count=`echo -n "" | wc -c | awk '{print $1}'` 16 | if [ $count -gt 0 ] 17 | then 18 | check_echo=2 19 | fi 20 | fi 21 | if [ $check_echo -eq 1 ] 22 | then 23 | echo -n "$@" 24 | else 25 | echo "$@\c" 26 | fi 27 | } 28 | 29 | 30 | fail=0 31 | 32 | myecho " " 33 | num=0 34 | count=0 35 | lim=10 36 | while [ -d ${count} ] 37 | do 38 | num=`expr $num + 1` 39 | if [ $count -lt 10 ] 40 | then 41 | myecho ".[0$count]" 42 | else 43 | myecho ".[$count]" 44 | fi 45 | ok=1 46 | (cd $count && ./run.sh) || ok=0 47 | if [ $ok -eq 0 ] 48 | then 49 | echo 50 | echo "** FAILED TEST $count **" 51 | fail=`expr $fail + 1` 52 | num=0 53 | fi 54 | count=`expr $count + 1` 55 | if [ $ok -eq 1 ] 56 | then 57 | if [ $num -eq $lim ] 58 | then 59 | echo 60 | myecho " " 61 | num=0 62 | fi 63 | else 64 | myecho " " 65 | num=0 66 | fi 67 | done 68 | 69 | if [ $num -ne 0 ] 70 | then 71 | echo 72 | fi 73 | 74 | 75 | if [ $fail -ne 0 ] 76 | then 77 | if [ $fail -eq 1 ] 78 | then 79 | echo "--- Summary: 1 test failed ---" 80 | else 81 | echo "--- Summary: $fail tests failed ---" 82 | fi 83 | exit 1 84 | else 85 | echo 86 | echo "SUCCESS! All tests passed." 87 | fi 88 | echo 89 | -------------------------------------------------------------------------------- /extra/Galois: -------------------------------------------------------------------------------- 1 | --- lonestar/scientific/cpu/longestedge/test/catch.hpp 2021-10-18 11:50:01.00000000 -0700 2 | +++ lonestar/scientific/cpu/longestedge/test/catch.hpp 2021-10-18 11:51:01.00000000 -0700 3 | @@ -7858,8 +7858,11 @@ namespace Catch { 4 | } 5 | 6 | #ifdef CATCH_PLATFORM_MAC 7 | - 8 | + #ifdef __arm64__ 9 | + #define CATCH_TRAP() __asm__(".inst 0xe7f001f0") 10 | + #else 11 | #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */ 12 | + #endif 13 | 14 | #elif defined(CATCH_PLATFORM_IPHONE) 15 | -------------------------------------------------------------------------------- /extra/Galois2: -------------------------------------------------------------------------------- 1 | --- CMakeLists.txt 2022-07-12 11:01:51.000000000 -0400 2 | +++ CMakeLists.txt.new 2022-07-12 11:01:46.000000000 -0400 3 | @@ -154,17 +154,17 @@ 4 | 5 | find_package(Boost 1.58.0 REQUIRED COMPONENTS serialization iostreams) 6 | 7 | -find_package(LLVM REQUIRED CONFIG) 8 | -if("${LLVM_PACKAGE_VERSION}" VERSION_LESS "7") 9 | - message(FATAL_ERROR "LLVM 7 or greater is required.") 10 | -endif() 11 | -if(NOT DEFINED LLVM_ENABLE_RTTI) 12 | - message(FATAL_ERROR "Could not determine if LLVM has RTTI enabled.") 13 | -endif() 14 | -if(NOT ${LLVM_ENABLE_RTTI}) 15 | - message(FATAL_ERROR "Galois requires a build of LLVM that includes RTTI. Most package managers do this already, but if you built LLVM from source you need to configure it with `-DLLVM_ENABLE_RTTI=ON`") 16 | -endif() 17 | -target_include_directories(LLVMSupport INTERFACE ${LLVM_INCLUDE_DIRS}) 18 | +#find_package(LLVM REQUIRED CONFIG) 19 | +#if("${LLVM_PACKAGE_VERSION}" VERSION_LESS "7") 20 | +# message(FATAL_ERROR "LLVM 7 or greater is required.") 21 | +#endif() 22 | +#if(NOT DEFINED LLVM_ENABLE_RTTI) 23 | +# message(FATAL_ERROR "Could not determine if LLVM has RTTI enabled.") 24 | +#endif() 25 | +#if(NOT ${LLVM_ENABLE_RTTI}) 26 | +# message(FATAL_ERROR "Galois requires a build of LLVM that includes RTTI. Most package managers do this already, but if you built LLVM from source you need to configure it with `-DLLVM_ENABLE_RTTI=ON`") 27 | +#endif() 28 | +#target_include_directories(LLVMSupport INTERFACE ${LLVM_INCLUDE_DIRS}) 29 | 30 | include(HandleSanitizer) 31 | 32 | @@ -210,14 +210,14 @@ 33 | 34 | add_subdirectory(libgpu) 35 | endif() 36 | -add_subdirectory(libpangolin) 37 | +#add_subdirectory(libpangolin) 38 | 39 | # Applications (apps) 40 | -add_subdirectory(lonestar) 41 | +#add_subdirectory(lonestar) 42 | 43 | add_subdirectory(scripts) 44 | -add_subdirectory(inputs) 45 | -add_subdirectory(tools) 46 | +#add_subdirectory(inputs) 47 | +#add_subdirectory(tools) 48 | 49 | if(USE_EXP) 50 | add_subdirectory(lonestar/experimental) 51 | -------------------------------------------------------------------------------- /extra/Galois3: -------------------------------------------------------------------------------- 1 | --- libgalois/CMakeLists.txt 2022-06-09 14:08:49.000000000 -0400 2 | +++ libgalois/CMakeLists.txt.new 2022-06-09 14:08:47.000000000 -0400 3 | @@ -104,7 +104,7 @@ 4 | endif() 5 | 6 | 7 | -add_subdirectory(test) 8 | +#add_subdirectory(test) 9 | 10 | install( 11 | DIRECTORY include/ 12 | -------------------------------------------------------------------------------- /extra/Galois4: -------------------------------------------------------------------------------- 1 | --- libgalois/src/HWTopoDarwin.cpp 2022-07-27 06:12:15.000000000 -0400 2 | +++ libgalois/src/HWTopoDarwin.cpp.new 2022-07-27 06:12:33.000000000 -0400 3 | @@ -119,8 +119,8 @@ 4 | if (thread_policy_set(machThread, THREAD_AFFINITY_POLICY, 5 | thread_policy_t(&policy), 6 | THREAD_AFFINITY_POLICY_COUNT)) { 7 | - galois::gWarn("Could not set CPU affinity to ", osContext, " (", 8 | - strerror(errno), ")"); 9 | + //galois::gWarn("Could not set CPU affinity to ", osContext, " (", 10 | + // strerror(errno), ")"); 11 | return false; 12 | } 13 | -------------------------------------------------------------------------------- /extra/Galois5: -------------------------------------------------------------------------------- 1 | --- lonestar/scientific/cpu/longestedge/test/catch.hpp 2025-02-05 17:47:01.00000000 -0700 2 | +++ lonestar/scientific/cpu/longestedge/test/catch.hpp 2025-02-05 17:48:01.00000000 -0700 3 | @@ -10735,7 +10735,14 @@ namespace Catch { 4 | 5 | // 32kb for the alternate stack seems to be sufficient. However, this value 6 | // is experimentally determined, so that's not guaranteed. 7 | +#ifdef MINSIGSTKSZ && ( ( MINSIGSTKSZ + 2 ) > 2 ) 8 | + // This is only true if MINSIGSTKSZ resolves to a number at preprocessor 9 | + // expansion time, instead of sysconf ( SIGSTKSZ ) because it is going to 10 | + // be used as a constant 11 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; 12 | +#else 13 | + static constexpr std::size_t sigStackSize = 32768; // >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; 14 | +#endif 15 | 16 | static SignalDefs signalDefs[] = { 17 | { SIGINT, "SIGINT - Terminal interrupt signal" }, 18 | -------------------------------------------------------------------------------- /gen_output.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Prints some progress markers to prevent CI tools 5 | # from marking the job as defunct. 6 | # 7 | 8 | check_echo=0 9 | myecho() 10 | { 11 | if [ $check_echo -eq 0 ] 12 | then 13 | check_echo=1 14 | count=`echo -n "" | wc -c | awk '{print $1}'` 15 | if [ $count -gt 0 ] 16 | then 17 | check_echo=2 18 | fi 19 | fi 20 | if [ $check_echo -eq 1 ] 21 | then 22 | echo -n "$@" 23 | else 24 | echo "$@\c" 25 | fi 26 | } 27 | 28 | 29 | file=$1 30 | if [ $# -eq 2 ] 31 | then 32 | threshold=$2 33 | else 34 | threshold=10 35 | fi 36 | 37 | myecho > $file 38 | 39 | nxt=0 40 | num=0 41 | count=0 42 | while read n 43 | do 44 | echo "$n" >> $file 45 | count=`expr $count + 1` 46 | if [ $count -eq $threshold ] 47 | then 48 | count=0 49 | num=`expr $num + 1` 50 | nxt=`expr $nxt + 1` 51 | myecho "${num}.." 52 | if [ $nxt -eq 10 ] 53 | then 54 | nxt=0 55 | echo 56 | fi 57 | fi 58 | done 59 | if [ $nxt -ne 0 ] 60 | then 61 | echo 62 | fi 63 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | test_act() { 4 | dir=$1 5 | msg=$2 6 | if [ -d $dir ] 7 | then 8 | echo 9 | echo "************************************************************" 10 | echo "************************************************************" 11 | echo "|" 12 | echo "| >>>>> Testing: $msg <<<<<" 13 | echo "|" 14 | echo "************************************************************" 15 | echo "************************************************************" 16 | ((((cd $dir; make runtest; echo $? >&3) | cat >&4) 3>&1) | (read res; exit $res)) 4>&1 17 | if [ $? -ne 0 ] 18 | then 19 | echo "FAILED" 20 | exit 1 21 | fi 22 | fi 23 | } 24 | 25 | export VLSI_TOOLS_SRC=`pwd`/act 26 | test_act act "core ACT lib" 27 | test_act actsim "actsim" 28 | 29 | export PATH=${PATH}:${ACT_HOME}/bin 30 | test_act chp2prs "chp2prs" 31 | 32 | test_act layout "layout library" 33 | test_act timing "cyclone" 34 | test_act crosstest "Cross Tools test" 35 | --------------------------------------------------------------------------------