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 25

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 25 alirezamon
package ProNOC;
4
 
5
 
6
 
7 16 alirezamon
use Glib qw/TRUE FALSE/;
8
 
9
 
10
use Gtk2;
11
use strict;
12
use warnings;
13
 
14 25 alirezamon
 
15
 
16 16 alirezamon
use lib 'lib/perl';
17
require "widget.pl";
18
require "interface_gen.pl";
19
require "ip_gen.pl";
20
require "soc_gen.pl";
21
require "mpsoc_gen.pl";
22 25 alirezamon
require "emulator.pl";
23 16 alirezamon
 
24
 
25
 
26
 
27 25 alirezamon
our $VERSION = '1.5.0';
28 16 alirezamon
 
29 25 alirezamon
sub main{
30 16 alirezamon
 
31
 
32
 
33
 
34 25 alirezamon
my($width,$hight)=max_win_size();
35
set_defualt_font_size();
36 16 alirezamon
 
37 25 alirezamon
 
38
# check if envirement variables are defined
39
if ( !defined $ENV{PRONOC_WORK} || !defined $ENV{QUARTUS_BIN}) {
40
        my $message;
41
        $message= "Warning: QUARTUS_BIN environment variable has not been set. It is required only for working with NoC emulator." if(!defined $ENV{QUARTUS_BIN});
42
        $message= $message."\n\nWarning: PRONOC_WORK envirement varibale has not been set." if(!defined $ENV{PRONOC_WORK});
43
        $message= $message."\n\nPlease add aformentioned variables to ~\.bashrc file e.g: export PRONOC_WORK=[path_to]/mpsoc_work.";
44
        message_dialog("$message");
45
 
46 16 alirezamon
}
47
 
48
 
49
my $notebook = Gtk2::Notebook->new;
50
 
51
my $intfc_gen=  intfc_main();
52 25 alirezamon
$notebook->append_page ($intfc_gen,Gtk2::Label->new_with_mnemonic ("  _Interface generator  "));
53 16 alirezamon
 
54
my $ipgen=ipgen_main();
55 25 alirezamon
$notebook->append_page ($ipgen,Gtk2::Label->new_with_mnemonic ("  _IP generator  "));
56 16 alirezamon
 
57
my $socgen=socgen_main();
58 25 alirezamon
$notebook->append_page ($socgen,Gtk2::Label->new_with_mnemonic ("  _Processing tile generator  "));
59 16 alirezamon
 
60
my $mpsocgen =mpsocgen_main();
61 25 alirezamon
$notebook->append_page ($mpsocgen,Gtk2::Label->new_with_mnemonic ("  _NoC based MPSoC generator  "));
62 16 alirezamon
 
63 25 alirezamon
my $emulator =emulator_main();
64
$notebook->append_page ($emulator,Gtk2::Label->new_with_mnemonic (" _NoC emulator "));
65 16 alirezamon
 
66
 
67
 
68
                my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef);
69
                $scrolled_win->set_policy( "automatic", "automatic" );
70
                $scrolled_win->add_with_viewport($notebook);
71
 
72
                my $window = def_win_size($width-100,$hight-100,"ProNoC");
73 17 alirezamon
                #$window->add($scrolled_win);
74 16 alirezamon
 
75
 
76
                my $navIco = Gtk2::Gdk::Pixbuf->new_from_file("./icons/ProNoC.png");         # advance1.png");  
77
                $window->set_default_icon($navIco);
78
 
79
 
80 17 alirezamon
 
81
 
82
 
83
 
84
 
85
 
86 25 alirezamon
                my @menu_items = (
87
 
88 17 alirezamon
 
89 25 alirezamon
  [ "/_File",            undef,        undef,          0, "<Branch>" ],
90
 # [ "/File/_New",        "<control>N", \&menuitem_cb,  0, "<StockItem>", 'gtk-new' ],
91
 # [ "/File/_Open",       "<control>O", \&menuitem_cb,  0, "<StockItem>", 'gtk-open' ],
92
 # [ "/File/_Save",       "<control>S", \&menuitem_cb,  0, "<StockItem>", 'gtk-save' ],
93
 # [ "/File/Save _As...", undef,        \&menuitem_cb,  0, "<StockItem>", 'gtk-save' ],
94
 # [ "/File/sep1",        undef,        \&menuitem_cb,  0, "<Separator>" ],
95
  [ "/File/_Quit",       "<control>Q", sub { Gtk2->main_quit },  0, "<StockItem>", 'gtk-quit' ],
96 17 alirezamon
 
97 25 alirezamon
  [ "/_View",                  undef, undef,         0, "<Branch>" ],
98
 
99
 
100
  ["/_Help",            undef,          undef,          0,       "<Branch>" ],
101
  ["/_Help/_About",     "F1",           \&about ,       0,       undef ],
102
  ["/_Help/_intf_gen",  "F2",           \&intfc_help,   0,       undef ],
103
  ["/_Help/_ip_gen",    "F3",           \&ip_help ,     0,       undef ],
104
  ["/_Help/_pt_gen",    "F4",           \&gt_help ,     0,       undef ],
105
  ["/_Help/_Tutorial_1", undef,         \&Tutorial_1 ,  0,       undef ],
106
  ["/_Help/_Tutorial_2",  undef,        \&Tutorial_2 ,  0,       undef ],
107
 
108
 
109
 
110
 
111
  #["/_View/_Font12",    undef,         sub{ setfont(12,,$window)} ,   0, "<RadioItem>" ],      
112
 
113
 
114
  #[ "/_Preferences",                  undef, undef,         0, "<Branch>" ],
115
  #[ "/_Preferences/_Color",           undef, undef,         0, "<Branch>" ],
116
  #[ "/_Preferences/Color/_Red",       undef, \&menuitem_cb, 0, "<RadioItem>" ],
117
  #[ "/_Preferences/Color/_Green",     undef, \&menuitem_cb, 0, "/Preferences/Color/Red" ],
118
  #[ "/_Preferences/Color/_Blue",      undef, \&menuitem_cb, 0, "/Preferences/Color/Red" ],
119
  #[ "/_Preferences/_Shape",           undef, undef,         0, "<Branch>" ],
120
  #[ "/_Preferences/Shape/_Square",    undef, \&menuitem_cb, 0, "<RadioItem>" ],
121
  #[ "/_Preferences/Shape/_Rectangle", undef, \&menuitem_cb, 0, "/Preferences/Shape/Square" ],
122
  #[ "/_Preferences/Shape/_Oval",      undef, \&menuitem_cb, 0, "/Preferences/Shape/Rectangle" ],
123
 
124 17 alirezamon
);
125
 
126
 
127
 
128
 
129
 
130 25 alirezamon
 
131
   #my $table = Gtk2::Table->new (1, 4, FALSE);
132
     my $vbox = Gtk2::VBox->new( FALSE, 0 );
133
 
134
      my $accel_group = Gtk2::AccelGroup->new;
135
      $window->add_accel_group ($accel_group);
136
 
137
      my $item_factory = Gtk2::ItemFactory->new ("Gtk2::MenuBar", "<main>",
138
                                                 $accel_group);
139
 
140
      # Set up item factory to go away with the window
141
      $window->{'<main>'} = $item_factory;
142
 
143
      # create menu items
144
      $item_factory->create_items ($window, @menu_items);
145
 
146
 
147
 
148
 
149
 $vbox->pack_start( $item_factory->get_widget ("<main>"), FALSE, FALSE, 0 );
150
 
151
 
152
 
153
 
154
  #  my $ui = Gtk2::UIManager->new;
155
  #  $ui->insert_action_group( $actions, 0 );
156
   # Add the actiongroup to the uimanager               
157
 #      $ui->insert_action_group($radio_actions,0);
158
 
159
  #  $window->add_accel_group( $ui->get_accel_group );
160
  #  $ui->add_ui_from_string($ui_info);
161
 
162
    #my $actions_media = Gtk2::ActionGroup->new ("media_dvd");
163
 
164
 
165
 
166
  # $vbox->pack_start( $ui->get_widget('/MenuBar'), FALSE, FALSE, 0 );
167 17 alirezamon
    $vbox->pack_end( $scrolled_win, TRUE, TRUE,10 );
168
 
169
$window->add($vbox);
170
 
171
 
172
 
173
 
174 16 alirezamon
                $window->set_resizable (1);
175
                $window->show_all();
176
 
177
 
178
 
179
 
180
 
181
 
182
 
183
 
184
 
185
}
186
 
187
 
188
 
189 17 alirezamon
sub about {
190
    my $about = Gtk2::AboutDialog->new;
191
    $about->set_authors("Alireza Monemi\n Email: alirezamonemi\@opencores.org");
192 25 alirezamon
    $about->set_version( $VERSION );
193 17 alirezamon
    $about->set_website('http://opencores.org/project,an-fpga-implementation-of-low-latency-noc-based-mpsoc');
194
    $about->set_comments('NoC based MPSoC generator.');
195 25 alirezamon
    $about->set_program_name('ProNoC');
196
 
197 17 alirezamon
    $about->set_license(
198
                 "This program is free software; you can redistribute it\n"
199
                . "and/or modify it under the terms of the GNU General \n"
200
                . "Public License as published by the Free Software \n"
201
                . "Foundation; either version 1, or (at your option)\n"
202
                . "any later version.\n\n"
203
 
204
        );
205 25 alirezamon
        # Add the Hide action to the 'Close' button in the AboutDialog():
206
    $about->signal_connect('response' => sub { $about->hide; });
207
 
208
 
209 17 alirezamon
    $about->run;
210
    $about->destroy;
211
    return;
212
}
213 16 alirezamon
 
214 17 alirezamon
sub intfc_help{
215
    my $dir = Cwd::getcwd();
216 25 alirezamon
    my $help="$dir/doc/ProNoC_intfc_gen.pdf";
217 17 alirezamon
    system qq (xdg-open $help);
218
    return;
219
 
220
}
221
 
222
sub ip_help{
223
    my $dir = Cwd::getcwd();
224 25 alirezamon
    my $help="$dir/doc/ProNoC_ip_gen.pdf";
225 17 alirezamon
    system qq (xdg-open $help);
226
    return;
227
}
228
 
229
 
230
 
231
sub pt_help{
232
    my $dir = Cwd::getcwd();
233 25 alirezamon
    my $help="$dir/doc/ProNoC_pt_gen.pdf";
234 17 alirezamon
    system qq (xdg-open $help);
235
    return;
236
}
237
 
238 25 alirezamon
sub Tutorial_1{
239
    my $dir = Cwd::getcwd();
240
    my $help="$dir/doc/ProNoC_Tutorial1.pdf";
241
    system qq (xdg-open $help);
242
    return;
243 17 alirezamon
 
244 25 alirezamon
}
245 17 alirezamon
 
246 25 alirezamon
sub Tutorial_2{
247
    my $dir = Cwd::getcwd();
248
    my $help="$dir/doc/ProNoC_Tutorial2.pdf";
249
    system qq (xdg-open $help);
250
    return;
251 17 alirezamon
 
252 25 alirezamon
}
253
 
254
 
255
 
256 16 alirezamon
Gtk2->init;
257
main;
258
Gtk2->main();

powered by: WebSVN 2.1.0

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