OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [perl_gui/] [ProNoC.pl] - Blame information for rev 16

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 alirezamon
#!/usr/bin/perl -w
2
 
3
use Glib qw/TRUE FALSE/;
4
 
5
 
6
use Gtk2;
7
use strict;
8
use warnings;
9
#use Image::Base::Gtk2::Gdk::Pixbuf;
10
 
11
use lib 'lib/perl';
12
require "widget.pl";
13
require "interface_gen.pl";
14
require "ip_gen.pl";
15
require "soc_gen.pl";
16
require "mpsoc_gen.pl";
17
require "noc_sim.pl";
18
 
19
 
20
 
21
 
22
 
23
sub set_deafualt_font{
24
        my($width,$hight)=@_;
25
        #print "($width,$hight)\n";
26
        my $font_size;
27
        if($width>1600){
28
            $font_size=10;
29
                Gtk2::Rc->parse_string(<<__);
30
                        style "normal" {
31
                                font_name ="Verdana 10"
32
                        }
33
                        widget "*" style "normal"
34
__
35
 
36
        }
37
        elsif ($width>1400){
38
                $font_size=9;
39
                Gtk2::Rc->parse_string(<<__);
40
                style "normal" {
41
                                font_name ="Verdana 9"
42
                        }
43
                        widget "*" style "normal"
44
__
45
 
46
        }
47
        elsif ($width>1200){
48
                $font_size=8;
49
                Gtk2::Rc->parse_string(<<__);
50
                style "normal" {
51
                                font_name ="Verdana 8"
52
                        }
53
                        widget "*" style "normal"
54
__
55
 
56
        }
57
        elsif ($width>1000){
58
            $font_size=7;
59
                Gtk2::Rc->parse_string(<<__);
60
                style "normal" {
61
                                font_name ="Verdana 7"
62
                        }
63
                        widget "*" style "normal"
64
__
65
 
66
        }
67
        else{
68
            $font_size=6;
69
                Gtk2::Rc->parse_string(<<__);
70
                style "normal" {
71
                                font_name ="Verdana 6"
72
                        }
73
                        widget "*" style "normal"
74
__
75
 
76
        }
77
        #print "            \$font_size=            $font_size\n";
78
        return      $font_size;
79
 
80
 
81
}
82
 
83
sub get_mpsoc{
84
        my ($ipgen,$soc_state,$info)=@_;
85
        my $description = "Will be available soon!";
86
        my $table = Gtk2::Table->new (15, 15, TRUE);
87
        #my $window=def_popwin_size(500,500,"Add description");
88
        my ($scrwin,$text_view)=create_text();
89
        #my $buffer = $textbox->get_buffer();
90
        my $ok=def_image_button("icons/select.png",' Ok ');
91
 
92
        $table->attach_defaults($scrwin,0,15,0,14);
93
        $table->attach_defaults($ok,6,9,14,15);
94
        my $text_buffer = $text_view->get_buffer;
95
        if(defined $text_buffer) {$text_buffer->set_text($description)};
96
 
97
        $ok->signal_connect("clicked"=> sub {
98
 
99
                my $text = $text_buffer->get_text($text_buffer->get_bounds, TRUE);
100
                # $ipgen->ipgen_set_description($text); 
101
                print "$text\n";
102
 
103
        });
104
 
105
        #$window->add($table);
106
        #$window->show_all();
107
        return $table;
108
 
109
}
110
 
111
 
112
 
113
 
114
sub main{
115
 
116
 
117
 
118
my $notebook = Gtk2::Notebook->new;
119
#$hbox->pack_start ($notebook, TRUE, TRUE, 0);
120
 
121
my($width,$hight)=max_win_size();
122
set_deafualt_font_size();
123
 
124
 
125
 
126
my $intfc_gen=  intfc_main();
127
$notebook->append_page ($intfc_gen,Gtk2::Label->new_with_mnemonic ("_Interface generator"));
128
 
129
my $ipgen=ipgen_main();
130
$notebook->append_page ($ipgen,Gtk2::Label->new_with_mnemonic ("_IP generator"));
131
 
132
my $socgen=socgen_main();
133
$notebook->append_page ($socgen,Gtk2::Label->new_with_mnemonic ("_Processing tile generator"));
134
 
135
my $mpsocgen =mpsocgen_main();
136
$notebook->append_page ($mpsocgen,Gtk2::Label->new_with_mnemonic ("_NoC based MPSoC generator"));
137
 
138
 
139
 
140
 
141
 
142
                my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
143
                $scrolled_win->set_policy( "automatic", "automatic" );
144
                $scrolled_win->add_with_viewport($notebook);
145
 
146
                my $window = def_win_size($width-100,$hight-100,"ProNoC");
147
                $window->add($scrolled_win);
148
 
149
 
150
                my $navIco = Gtk2::Gdk::Pixbuf->new_from_file("./icons/ProNoC.png");         # advance1.png");  
151
                $window->set_default_icon($navIco);
152
 
153
 
154
                $window->set_resizable (1);
155
                $window->show_all();
156
 
157
 
158
 
159
 
160
 
161
 
162
 
163
 
164
 
165
}
166
 
167
 
168
 
169
 
170
Gtk2->init;
171
main;
172
Gtk2->main();

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.