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 31

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

powered by: WebSVN 2.1.0

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