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 32

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

powered by: WebSVN 2.1.0

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