KEMBAR78
ABC GettingStarted | PDF
0% found this document useful (0 votes)
250 views26 pages

ABC GettingStarted

ABC is a software system for synthesis and verification of sequential logic circuits. The document discusses downloading, installing, and using ABC. It provides an overview of commands in ABC and demonstrates how to create a new command by defining the necessary files and functions.

Uploaded by

Qinzi Ling
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
250 views26 pages

ABC GettingStarted

ABC is a software system for synthesis and verification of sequential logic circuits. The document discusses downloading, installing, and using ABC. It provides an overview of commands in ABC and demonstrates how to create a new command by defining the necessary files and functions.

Uploaded by

Qinzi Ling
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Getting started with

ABC: A System for Sequential


Synthesis and Verification
Ana Petkovska
ana.petkovska@epfl.ch
EPFL – IC – LAP

Lausanne, 28.02.2016
Outline
• Introduction
• Download, Install, Use
• Inside ABC
• Create Your First Command

2
What is ABC?
• ABC is a growing software system for synthesis and verification of binary
sequential logic circuits appearing in synchronous hardware designs.
• ABC combines scalable logic optimization based on And-Inverter Graphs (AIGs),
optimal-delay DAG-based technology mapping for look-up tables and standard
cells, and innovative algorithms for sequential synthesis and verification.
• You can find more information at http://www.eecs.berkeley.edu/~alanmi/abc/

Source http://www.eecs.berkeley.edu/~alanmi/abc/
Outline
• Introduction
• Download, Install, Use
• Inside ABC
• Create Your First Command

4
Get ABC [1]
• The latest version of ABC can be downloaded from
https://bitbucket.org/alanmi/abc

5
Get ABC [2]
• The latest version of ABC can be downloaded from
https://bitbucket.org/alanmi/abc

6
Install ABC
• Compile ABC as a binary
 download and unzip the code
 go in the directory and type make

• This executes the Makefile [abc/Makefile]


• If you want to delete all intermediate and output files created in the compilation
process type make clean (Do not do it now!)

7
Install ABC
• If the compilation process ends successfully you will get

• If there are errors in the compilation process then read the “Troubleshooting”
section in the readme file [abc/readme.md]

8
Use ABC
• After successful compilation, you can call the command line interpreter of ABC

where you can execute commands implemented into ABC

9
Short Example
• Create a new folder called examples
• Copy the following Verilog code in a file named rca2.v
module rca2 (a0, b0, a1, b1, s0, s1, s2);
//-------------Input Ports Declarations-----------------------------
input a0, b0, a1, b1;
//-------------Output Ports Declarations-----------------------------
output s0, s1, s2;
//-------------Wires-----------------------------------------------
wire c0;
//-------------Logic-----------------------------------------------
assign s0 = a0 ^ b0 ;
assign c0 = a0 & b0 ;
assign s1 = a1 ^ b1 ^ c0;
assign s2 = (a1 & b1) | (c0 & (a1 ^ b1));
endmodule

10
Short Example
• Go in the directory abc/examples
• Start ABC by typing ../abc
• Read the circuit defined in rca2.v using the command read (type read rca2.v)
• Do structural hashing using the command strash
• Print the information about the circuit using the command print_stats

11
Commands
• You can find short description of part of the existing commands at
http://www.eecs.berkeley.edu/~alanmi/abc/
in the section “Command summary”
• You can use aliases defined in the abc.rc file [abc/abc.rc]
 For example, instead of read rca2.v you can write r rca2.v
 You can also define your own aliases there

12
Outline
• Introduction
• Download, Install, Use
• Inside ABC
• Create Your First Command

13
Inside ABC
• Most of the implemented commands are defined in the following files
 src/base/abci/abc.c
 src/base/io/io.c
• The declarations of the basic commands for working with ABC networks can be
found in
 src/base/abc/abc.h

14
Outline
• Introduction
• Download, Install, Use
• Inside ABC
• Create Your First Command

15
Create a new command
• In the folder src create new folder testFirst with the
following files
 module.make where you will list your .c files for compilation
 testcmd.c where you will declare and define your commands
 testfirst.c where you will define your main functions
 testfirst.h where you will declare your main functions

16
File module.make
• In this file you should list your .c files for compilation; thus it has the following content

• Also, you should list your folder as new module in the Makefile [abc/Makefile]

17
File testfirst.c [1]
• It is a good practice to start all files with information about the file itself.
• Then, we list the needed libraries and the declarations of the functions that are defined in the file
and are used just in this file.

18
File testfirst.c [2]
• Next, we define the function that will be called from our command.
• It extracts the network that is read into ABC and calls another function.

19
File testfirst.c [3]
• Finally, we define a function that use the network and prints information about it.

20
File testfirst.h
• In this file we declare the functions from our module that can be globally used.

21
File testcmd.c [1]
• First, we list the needed libraries and the declarations of the functions that define the commands.
• Next, we include one initialization function for module initialization and for inserting the command
in the system.

22
File testcmd.c [2]
• Next, we give the definitions of the functions that implement our commands.

23
File src/base/main/mainInit.c
• The file src/base/main/mainInit.c is the only file from the source code of ABC that we need to
change.
• To include our command in the system and to initialize it, we use the previously mentioned
initialization function in the function Abc_FrameInit() for what we add the two lines shown below.

24
Test the new command
• To test the new command recompile ABC by typing make
• Then, start ABC, read a network and test the command

25
Recommended reading
• “Going Places with ABC” - a presentation that introduces basics of
programming in ABC:
• “Quick Look under the Hood of ABC: A Programmer’s Manual” - a
paper that gives an overview of the ABC programming environment
• “Constructing AIGs in ABC: A Tutorial” - a write-up that shows how to
programmably construct AIG in the user’s application

• All documents are available at


http://www.eecs.berkeley.edu/~alanmi/abc/
under the section “Programming notes”

26

You might also like