<?php
    # $Id: initTables.php,v 1.6 2007/01/16 21:14:38 jarda Exp $

    /* Fills tables with some initial useful data
    */

    require_once('simplePage.inc.php');

    class PageClass extends EditDBSimplePage
    {
        
        function createPage()
        {
            $db = connect();

            $this->fillFormats($db);
            $this->fillBenchmarkSets($db);
            $this->fillFormatAttributes($db);
            $this->fillAttributes($db);
        }
        

        function fillAttributes($db)
        {
            $db->Execute("INSERT INTO attribute VALUES (1, 'BUF count', '')");
            $db->Execute("INSERT INTO attribute VALUES (2, 'NOT count', '')");
            $db->Execute("INSERT INTO attribute VALUES (3, 'AND count', '')");
            $db->Execute("INSERT INTO attribute VALUES (4, 'OR count', '')");
            $db->Execute("INSERT INTO attribute VALUES (5, 'XOR count', '')");
            $db->Execute("INSERT INTO attribute VALUES (6, 'XNOR count', '')");
            $db->Execute("INSERT INTO attribute VALUES (7, 'NAND count', '')");
            $db->Execute("INSERT INTO attribute VALUES (8, 'NOR count', '')");
            $db->Execute("INSERT INTO attribute VALUES (10, 'General gates count', '')");
            $db->Execute("INSERT INTO attribute VALUES (11, 'Gates count', '')");
            $db->Execute("INSERT INTO attribute VALUES (12, 'DFF count', '')");
            $db->Execute("INSERT INTO attribute VALUES (13, 'Inputs count', '')");
            $db->Execute("INSERT INTO attribute VALUES (14, 'Outputs count', '')");
            $db->Execute("INSERT INTO attribute VALUES (15, 'Terms count', '')");
            $db->Execute("INSERT INTO attribute VALUES (16, 'States count', '')");
            $db->Execute("INSERT INTO attribute VALUES (17, 'Reset state', '')");
            $db->Execute("INSERT INTO attribute VALUES (18, 'Transitions count', '')");
        }


        function fillBenchmarkSets($db)
        {
            $db->Execute("INSERT INTO benchmarkset VALUES (4, 'HLSynth89', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (5, 'HLSynth91', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (6, 'HLSynth92', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (7, 'ITC99', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (8, 'IWLS93', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (9, 'Iscas', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (10, 'LGSynth89', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (11, 'LGSynth91', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (12, 'LGSynth93', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (13, 'MCNC', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (14, 'OpenRisc1200', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (15, 'POLO', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (16, 'Partitioning93', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (17, 'Synthesized', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (18, 'Torino', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (2, '8051', '')");
            $db->Execute("INSERT INTO benchmarkset VALUES (3, 'FFT', '')");
        }


        function fillFormats($db)
        {
            $db->Execute("INSERT INTO format VALUES (1, 'BENCH', '')");
            $db->Execute("INSERT INTO format VALUES (2, 'BLIF', '')");
            $db->Execute("INSERT INTO format VALUES (3, 'KISS2', '')");
            $db->Execute("INSERT INTO format VALUES (4, 'PLA', '')");
            $db->Execute("INSERT INTO format VALUES (5, 'SLIF', '')");
        }


        function fillFormatAttributes($db)
        {
            # bench {{{
            $db->Execute("INSERT INTO formatattribute VALUES (1, 1)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 2)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 3)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 4)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 5)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 6)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 7)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 8)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 10)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 11)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 12)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 13)");
            $db->Execute("INSERT INTO formatattribute VALUES (1, 14)");
            # }}}

            # blif {{{
            $db->Execute("INSERT INTO formatattribute VALUES (2, 1)");
            $db->Execute("INSERT INTO formatattribute VALUES (2, 2)");
            $db->Execute("INSERT INTO formatattribute VALUES (2, 3)");
            $db->Execute("INSERT INTO formatattribute VALUES (2, 4)");
            $db->Execute("INSERT INTO formatattribute VALUES (2, 7)");
            $db->Execute("INSERT INTO formatattribute VALUES (2, 8)");
            $db->Execute("INSERT INTO formatattribute VALUES (2, 10)");
            $db->Execute("INSERT INTO formatattribute VALUES (2, 11)");
            #$db->Execute("INSERT INTO formatattribute VALUES (2, 12)");
            #$db->Execute("INSERT INTO formatattribute VALUES (2, 13)");
            #$db->Execute("INSERT INTO formatattribute VALUES (2, 14)");
            # }}}
            
            # kiss 2 {{{
            $db->Execute("INSERT INTO formatattribute VALUES (3, 13)");
            $db->Execute("INSERT INTO formatattribute VALUES (3, 14)");
            $db->Execute("INSERT INTO formatattribute VALUES (3, 16)");
            $db->Execute("INSERT INTO formatattribute VALUES (3, 17)");
            $db->Execute("INSERT INTO formatattribute VALUES (3, 18)");
            # }}}
            
            # pla {{{
            $db->Execute("INSERT INTO formatattribute VALUES (4, 13)");
            $db->Execute("INSERT INTO formatattribute VALUES (4, 14)");
            $db->Execute("INSERT INTO formatattribute VALUES (4, 15)");
            # }}}

            # slif {{{
            $db->Execute("INSERT INTO formatattribute VALUES (5, 1)");
            $db->Execute("INSERT INTO formatattribute VALUES (5, 2)");
            $db->Execute("INSERT INTO formatattribute VALUES (5, 3)");
            $db->Execute("INSERT INTO formatattribute VALUES (5, 4)");
            $db->Execute("INSERT INTO formatattribute VALUES (5, 7)");
            $db->Execute("INSERT INTO formatattribute VALUES (5, 8)");
            $db->Execute("INSERT INTO formatattribute VALUES (5, 10)");
            $db->Execute("INSERT INTO formatattribute VALUES (5, 11)");
            $db->Execute("INSERT INTO formatattribute VALUES (5, 12)");
            $db->Execute("INSERT INTO formatattribute VALUES (5, 13)");
            $db->Execute("INSERT INTO formatattribute VALUES (5, 14)");
            #$db->Execute("INSERT INTO formatattribute VALUES (5, 15)");
            # }}}
        }

    }

    
    launchPage();

    # vim:enc=iso8859-2:fenc=iso8859-2:
?>
