1 |
48 |
alirezamon |
#!/usr/bin/perl -w
|
2 |
|
|
|
3 |
|
|
use strict;
|
4 |
|
|
use warnings;
|
5 |
|
|
|
6 |
|
|
use FindBin;
|
7 |
|
|
use lib $FindBin::Bin;
|
8 |
|
|
|
9 |
|
|
require "widget.pl";
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
use constant::boolean;
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
use Data::Dumper;
|
16 |
|
|
use File::Which;
|
17 |
|
|
use File::Basename;
|
18 |
|
|
|
19 |
|
|
use IPC::Run qw( harness start pump finish timeout );
|
20 |
|
|
use String::Scanf; # imports sscanf()
|
21 |
|
|
use base 'Class::Accessor::Fast';
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
use Consts;
|
25 |
|
|
BEGIN {
|
26 |
|
|
my $module = (Consts::GTK_VERSION==2) ? 'Gtk2' : 'Gtk3';
|
27 |
|
|
my $file = $module;
|
28 |
|
|
$file =~ s[::][/]g;
|
29 |
|
|
$file .= '.pm';
|
30 |
|
|
require $file;
|
31 |
|
|
$module->import;
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
__PACKAGE__->mk_accessors(qw{
|
37 |
|
|
window
|
38 |
|
|
sourceview
|
39 |
|
|
});
|
40 |
|
|
|
41 |
|
|
my $NAME = 'Uart Terminal';
|
42 |
|
|
my $path = "";
|
43 |
|
|
our $FONT_SIZE='default';
|
44 |
|
|
our $ICON_SIZE='default';
|
45 |
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
sub uart_stand_alone(){
|
49 |
|
|
$path = "../../";
|
50 |
|
|
set_path_env();
|
51 |
|
|
my $project_dir = get_project_dir(); #mpsoc dir addr
|
52 |
|
|
my $paths_file= "$project_dir/mpsoc/perl_gui/lib/Paths";
|
53 |
|
|
if (-f $paths_file){#} && defined $ENV{PRONOC_WORK} ) {
|
54 |
|
|
my $paths= do $paths_file;
|
55 |
|
|
my %p=%{$paths};
|
56 |
|
|
$FONT_SIZE= $p{'GUI_SETTING'}{'FONT_SIZE'} if (defined $p{'GUI_SETTING'}{'FONT_SIZE'});
|
57 |
|
|
$ICON_SIZE= $p{'GUI_SETTING'}{'ICON_SIZE'} if (defined $p{'GUI_SETTING'}{'ICON_SIZE'});
|
58 |
|
|
}
|
59 |
|
|
|
60 |
|
|
set_defualt_font_size();
|
61 |
|
|
my $window=uart_main();
|
62 |
|
|
$window->signal_connect (destroy => sub { gui_quite();});
|
63 |
|
|
}
|
64 |
|
|
|
65 |
|
|
exit gtk_gui_run(\&uart_stand_alone) unless caller;
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
sub create_rsv_box {
|
71 |
|
|
my ($self,$num)=@_;
|
72 |
|
|
my ($sw,$tview) =create_txview();
|
73 |
|
|
$sw->set_policy('never','automatic');
|
74 |
|
|
$sw->set_border_width(3);
|
75 |
|
|
my($width,$hight)=max_win_size();
|
76 |
|
|
$sw->set_size_request($width/10,$hight/10);
|
77 |
|
|
my $frame = gen_frame();
|
78 |
|
|
$frame->set_shadow_type ('in');
|
79 |
|
|
$frame->add ($sw);
|
80 |
|
|
my $def = 126-$num;
|
81 |
|
|
my $spin=gen_spin_object($self,'CTRL',"INDEX_$num",'0,128,1',$def,undef,undef);
|
82 |
|
|
my $label=gen_label_in_center("INDEX#");
|
83 |
|
|
my $box=def_pack_hbox( FALSE, 0 , $label,$spin);
|
84 |
|
|
$frame->set_label_widget ($box);
|
85 |
|
|
return ($frame,$tview);
|
86 |
|
|
}
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
sub receive_boxes{
|
91 |
|
|
my $self=shift;
|
92 |
|
|
my $table= def_table(2,10,FALSE);
|
93 |
|
|
my $scrolled_win=gen_scr_win_with_adjst ($self,"receive_box");
|
94 |
|
|
add_widget_to_scrolled_win($table,$scrolled_win);
|
95 |
|
|
my $num = $self->object_get_attribute('CTRL','UART_NUM');
|
96 |
|
|
my $dim_y = floor(sqrt($num));
|
97 |
|
|
my @tviews;
|
98 |
|
|
for (my $i=0; $i<$num; $i+=1){
|
99 |
|
|
my ($box,$tview) = create_rsv_box($self,$i);
|
100 |
|
|
$tviews[$i]=$tview;
|
101 |
|
|
my $y= int($i/$dim_y);
|
102 |
|
|
my $x= $i % $dim_y;
|
103 |
|
|
$table->attach_defaults ($box, $x, $x+1 , $y, $y+1);
|
104 |
|
|
}
|
105 |
|
|
return ($scrolled_win,\@tviews);
|
106 |
|
|
}
|
107 |
|
|
|
108 |
|
|
sub ctrl_boxes{
|
109 |
|
|
my ($self,$main_tview)=@_;
|
110 |
|
|
|
111 |
|
|
my $state=$self->object_get_attribute("CTRL","RUN");
|
112 |
|
|
if (!defined $state){
|
113 |
|
|
$state='OFF' ;
|
114 |
|
|
$self->object_add_attribute("CTRL","RUN",$state);
|
115 |
|
|
}
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
my $table= def_table(2,10,FALSE);
|
119 |
|
|
my $scrolled_win=add_widget_to_scrolled_win ($table);
|
120 |
|
|
my ($row,$col)=(0,0);
|
121 |
|
|
my @info = (
|
122 |
|
|
#TODO add Altera_Qsys_UART
|
123 |
|
|
{ label=>" UART name ", param_name=>'UART_NAME', type=>"Combo-box", default_val=>'ProNoC_XILINX_UART', content=>"ProNoC_XILINX_UART,ProNoC_ALTERA_UART", info=>undef, param_parent=>'CTRL', ref_delay=> 1, new_status=>'ref_ctrl', loc=>'vertical'},
|
124 |
|
|
{ label=>" Number of UART", param_name=>'UART_NUM', type=>"Spin-button", default_val=>1, content=>"1,128,1", info=>undef, param_parent=>'CTRL', ref_delay=> 1, new_status=>'ref_all', loc=>'vertical'}
|
125 |
|
|
|
126 |
|
|
);
|
127 |
|
|
|
128 |
|
|
|
129 |
|
|
my $uname= $self->object_get_attribute('CTRL','UART_NAME');
|
130 |
|
|
$uname = 'ProNoC_XILINX_UART' if(!defined $uname);
|
131 |
|
|
if ($uname eq "ProNoC_XILINX_UART" ) {
|
132 |
|
|
push (@info,{ label=>" JTAG CHAIN ", param_name=>'JTAG_CHAIN', type=>"Combo-box", default_val=>3, content=>"1,2,3,4", info=>undef, param_parent=>'CTRL', ref_delay=> 1, new_status=>'ref_ctrl', loc=>'vertical'}) ;
|
133 |
|
|
push (@info,{ label=>" JTAG TARGET ", param_name=>'JTAG_TARGET', type=>"Spin-button", default_val=>3, content=>"1,128,1", info=>"The FPGA device target number in the Jtag chain. Click on the front magnifier Icon to see the list of devices in your board JTAG chain.", param_parent=>'CTRL', ref_delay=> 1, new_status=>'ref_ctrl', loc=>'vertical'}) ;
|
134 |
|
|
}elsif ($uname eq "ProNoC_ALTERA_UART" ) {
|
135 |
|
|
my $list= $self->object_get_attribute('CTRL','quartus_device_list');
|
136 |
|
|
push (@info,{ label=>" Hardware Name", param_name=>'quartus_hardware', type=>"Entry", default_val=>undef, content=>undef, info=>undef, param_parent=>'CTRL', ref_delay=> 1, new_status=>undef, loc=>'vertical'}) ;
|
137 |
|
|
push (@info,{ label=>" Device Number", param_name=>'quartus_device', type=>"EntryCombo", default_val=>undef, content=>$list, info=>undef,param_parent=>'CTRL', ref_delay=> 1, new_status=>undef, loc=>'vertical'}) ;
|
138 |
|
|
}
|
139 |
|
|
|
140 |
|
|
|
141 |
|
|
my @restricted_params= ('UART_NAME','JTAG_TARGET','quartus_hardware','quartus_device');
|
142 |
|
|
|
143 |
|
|
foreach my $d (@info) {
|
144 |
|
|
my $wiget;
|
145 |
|
|
($row,$col,$wiget)=add_param_widget ($self, $d->{label}, $d->{param_name}, $d->{default_val}, $d->{type}, $d->{content}, $d->{info}, $table,$row,$col,1, $d->{param_parent}, $d->{ref_delay}, $d->{new_status}, $d->{loc});
|
146 |
|
|
|
147 |
|
|
#the following parameter should not be changed while the jtag connection is stablished
|
148 |
|
|
if($state eq "ON"){
|
149 |
|
|
$wiget->set_sensitive (FALSE) if (check_scolar_exist_in_array($d->{param_name},\@restricted_params ));
|
150 |
|
|
}
|
151 |
|
|
|
152 |
|
|
|
153 |
|
|
if($d->{param_name} eq 'JTAG_TARGET' || $d->{param_name} eq "quartus_hardware"){
|
154 |
|
|
my $search=def_image_button($path."icons/browse.png");
|
155 |
|
|
$table->attach ($search, 4, 5,$row-1,$row,'shrink','shrink',2,2);
|
156 |
|
|
set_tip($search, "Display all Jtag targets. You need to connect your FPGA device to your PC first.");
|
157 |
|
|
$search-> signal_connect("clicked" => sub{
|
158 |
|
|
show_all_xilinx_targets ($self,$main_tview) if($uname eq "ProNoC_XILINX_UART");
|
159 |
|
|
capture_altera_jtag_info($self,$main_tview) if($uname eq "ProNoC_ALTERA_UART");
|
160 |
|
|
});
|
161 |
|
|
|
162 |
|
|
}
|
163 |
|
|
}
|
164 |
|
|
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
$col=0;
|
168 |
|
|
my $label=gen_label_in_left(" JTAG Connect ");
|
169 |
|
|
my $run= ($state eq 'ON')? def_colored_button('ON',17): def_colored_button('OFF',4);
|
170 |
|
|
$table->attach ($label, $col, $col+1,$row,$row+1,'fill','shrink',2,2); $col+=1;
|
171 |
|
|
$table->attach ($run, $col, $col+1,$row,$row+1,'shrink','shrink',2,2); $row++;$col=0;
|
172 |
|
|
$run -> signal_connect("clicked" => sub{
|
173 |
|
|
my $state=$self->object_get_attribute("CTRL","RUN");
|
174 |
|
|
my $new = ($state eq "ON")? "OFF" : "ON";
|
175 |
|
|
$self->object_add_attribute("CTRL","CONNECT",1) if($new eq 'ON');
|
176 |
|
|
$self->object_add_attribute("CTRL","DISCONNECT",1) if($new eq 'OFF');
|
177 |
|
|
set_gui_status($self,"ON-OFF",1);
|
178 |
|
|
});
|
179 |
|
|
|
180 |
|
|
return $scrolled_win;
|
181 |
|
|
}
|
182 |
|
|
|
183 |
|
|
|
184 |
|
|
|
185 |
|
|
sub select_uart_board {
|
186 |
|
|
my ($self,$table,$vendor,$row,$col)=@_;
|
187 |
|
|
|
188 |
|
|
#get the list of boards located in "boards/*" folder
|
189 |
|
|
my @dirs = grep {-d} glob("$path/../boards/$vendor/*");
|
190 |
|
|
my ($fpgas,$init);
|
191 |
|
|
$fpgas="";
|
192 |
|
|
|
193 |
|
|
foreach my $dir (@dirs) {
|
194 |
|
|
my ($name,$fpath,$suffix) = fileparse("$dir",qr"\..[^.]*$");
|
195 |
|
|
|
196 |
|
|
$fpgas= (defined $fpgas)? "$fpgas,$name" : "$name";
|
197 |
|
|
$init="$name";
|
198 |
|
|
}
|
199 |
|
|
my $button=def_image_button("$path/icons/help.png");
|
200 |
|
|
my $help1= "The list of supported boards are obtained from \"mpsoc/boards/$vendor\" path. You can add your boards by adding its required files in aforementioned path";
|
201 |
|
|
$button->signal_connect("clicked" => sub {message_dialog($help1);});
|
202 |
|
|
my $combo=gen_combobox_object ($self,'compile','board',$fpgas,$init,undef,undef);
|
203 |
|
|
$table->attach(gen_label_in_left('Targeted Board:'),$col,$col+1,$row,$row+1,'fill','shrink',2,2);$col++;
|
204 |
|
|
$table->attach($button,$col,$col+1,$row,$row+1,'fill','shrink',2,2);$col++;
|
205 |
|
|
$table->attach($combo, $col,$col+1,$row,$row+1,'fill','shrink',2,2);$row++;
|
206 |
|
|
|
207 |
|
|
#do not change the board when the connection is ON
|
208 |
|
|
my $state=$self->object_get_attribute("CTRL","RUN");
|
209 |
|
|
$combo->set_sensitive (FALSE) if($state eq "ON" );
|
210 |
|
|
|
211 |
|
|
|
212 |
|
|
}
|
213 |
|
|
|
214 |
|
|
|
215 |
|
|
|
216 |
|
|
sub capture_altera_jtag_info {
|
217 |
|
|
my ($self,$tview) = @_;
|
218 |
|
|
my $command= "$ENV{QUARTUS_BIN}/jtagconfig";
|
219 |
|
|
#add_info($tview,"$command\n");
|
220 |
|
|
my $stdout= run_cmd_textview_errors($command,$tview);
|
221 |
|
|
if(!defined $stdout){
|
222 |
|
|
add_colored_info($tview,"No JTAG Hardware is detected\n",'red');
|
223 |
|
|
return 1;
|
224 |
|
|
}
|
225 |
|
|
#add_info($tview,"$stdout\n");
|
226 |
|
|
my @a=split /1\)\s+/, $stdout;
|
227 |
|
|
if(!defined $a[1]){
|
228 |
|
|
add_colored_info($tview,"No JTAG Hardware is detected\n",'red');
|
229 |
|
|
return 1;
|
230 |
|
|
}
|
231 |
|
|
my @b=split /\s+/, $a[1];
|
232 |
|
|
my $hw=$b[0];
|
233 |
|
|
|
234 |
|
|
|
235 |
|
|
|
236 |
|
|
|
237 |
|
|
my @devs=split /\n/, $stdout;
|
238 |
|
|
|
239 |
|
|
$self->object_add_attribute('CTRL','quartus_hardware',$hw);
|
240 |
|
|
add_colored_info($tview,"Detected Hardware: $hw\n",'blue');
|
241 |
|
|
|
242 |
|
|
#capture device name in JTAG chain
|
243 |
|
|
|
244 |
|
|
my $i=0;
|
245 |
|
|
my $info="";
|
246 |
|
|
my $list;
|
247 |
|
|
foreach my $p (@devs){
|
248 |
|
|
next if ($p =~/^\s*1\)/);
|
249 |
|
|
$i++;
|
250 |
|
|
$info .= "\t $i : $p\n";
|
251 |
|
|
$list= (defined $list) ? "$list,$i" : $i;
|
252 |
|
|
|
253 |
|
|
}
|
254 |
|
|
|
255 |
|
|
$info = "There are total of $i devices in JTAG chain:\n $info. Select the corresponding Jtag device number which the serial port is connected to\n";
|
256 |
|
|
|
257 |
|
|
|
258 |
|
|
my $names = join (',',@devs);
|
259 |
|
|
add_colored_info($tview,"$info",'blue');
|
260 |
|
|
$self->object_add_attribute('CTRL','quartus_device_list',$list);
|
261 |
|
|
$self->object_add_attribute('CTRL','quartus_device',$i);
|
262 |
|
|
set_gui_status($self,'ref_ctrl',1);
|
263 |
|
|
return 0;
|
264 |
|
|
}
|
265 |
|
|
|
266 |
|
|
|
267 |
|
|
|
268 |
|
|
|
269 |
|
|
|
270 |
|
|
|
271 |
|
|
|
272 |
|
|
sub show_all_xilinx_targets{
|
273 |
|
|
my ($self,$tview) =@_;
|
274 |
|
|
my ($pipe,$in, $out, $err,$r);
|
275 |
|
|
my $xsct = which('xsct');
|
276 |
|
|
|
277 |
|
|
#check if $xsct exits
|
278 |
|
|
unless(-f $xsct){
|
279 |
|
|
add_colored_info($tview,"Error xsct not found. Please add the path to xilinx/SDK/bin to your \$PATH environment\n",'red');
|
280 |
|
|
return 0;
|
281 |
|
|
}
|
282 |
|
|
my @cat = ( $xsct );
|
283 |
|
|
$pipe =start \@cat, \$in, \$out, \$err or $r=$?;
|
284 |
|
|
if(defined $r){
|
285 |
|
|
add_colored_info($tview," quartus_stp got an Error: $r\n",'red');
|
286 |
|
|
return 0;
|
287 |
|
|
}
|
288 |
|
|
|
289 |
|
|
$in = "";
|
290 |
|
|
return 0 unless run_xsct_pipe($self,\$pipe,\$in,\$out,\$err,$tview);
|
291 |
|
|
$in = "set jseq [jtag sequence]\n connect\n";
|
292 |
|
|
return 0 unless run_xsct_pipe($self,\$pipe,\$in,\$out,\$err,$tview);
|
293 |
|
|
$in = "set R [jtag targets]\n puts \$R \n";
|
294 |
|
|
return 0 unless run_xsct_pipe($self,\$pipe,\$in,\$out,\$err,$tview);
|
295 |
|
|
if (length ($out)> 10){
|
296 |
|
|
add_colored_info($tview,"targets are:\n $out .\n",'blue');
|
297 |
|
|
}else {
|
298 |
|
|
add_colored_info($tview,"No Jtag target is detected. Make sure your FPGA board is connected to the PC and it is powered on.\n",'red');
|
299 |
|
|
}
|
300 |
|
|
close_xsct($self,\$pipe,$tview,\$in, \$out, \$err);
|
301 |
|
|
return $out;
|
302 |
|
|
}
|
303 |
|
|
|
304 |
|
|
|
305 |
|
|
|
306 |
|
|
sub sender_box{
|
307 |
|
|
my ($self,$main_tview)=@_;
|
308 |
|
|
my $table= def_table(2,10,FALSE);
|
309 |
|
|
my $scrolled_win=add_widget_to_scrolled_win ($table);
|
310 |
|
|
my ($sw,$tview) =create_txview();
|
311 |
|
|
$sw->set_policy('never','automatic');
|
312 |
|
|
$sw->set_border_width(3);
|
313 |
|
|
my($width,$hight)=max_win_size();
|
314 |
|
|
$sw->set_size_request($width/10,$hight/10);
|
315 |
|
|
my $frame = gen_frame();
|
316 |
|
|
$frame->set_shadow_type ('in');
|
317 |
|
|
$frame->add ($sw);
|
318 |
|
|
my $num = $self->object_get_attribute('CTRL','UART_NUM');
|
319 |
|
|
my @indexs;
|
320 |
|
|
my $def;
|
321 |
|
|
for (my $i=0; $i<$num; $i+=1){
|
322 |
|
|
my $index= $self->object_get_attribute("CTRL","INDEX_$i");
|
323 |
|
|
$def= $index if(!defined $def);
|
324 |
|
|
$indexs[$i]=$index;
|
325 |
|
|
}
|
326 |
|
|
my $indexs = join(',',@indexs);
|
327 |
|
|
my $comb=gen_combobox_object($self,'CTRL',"SEND_TO_INDEX",$indexs,$def,undef,undef);
|
328 |
|
|
my $label=gen_label_in_center("SEND_TO INDEX#");
|
329 |
|
|
my $send = def_image_button($path.'icons/run.png');
|
330 |
|
|
my $box=def_pack_hbox( FALSE, 0 , $label,$comb,$send);
|
331 |
|
|
$frame->set_label_widget ($box);
|
332 |
|
|
$table->attach_defaults ($frame, 0, 1 , 0,1);
|
333 |
|
|
$send-> signal_connect("clicked" => sub{
|
334 |
|
|
my $st =$self->object_get_attribute("CTRL","RUN");
|
335 |
|
|
my $index =$self->object_get_attribute("CTRL","SEND_TO_INDEX");
|
336 |
|
|
if ($st eq 'OFF'){
|
337 |
|
|
add_colored_info($main_tview,"Error: Cannot send the data. Jtag connection is not established yet.\n",'red');
|
338 |
|
|
return;
|
339 |
|
|
}
|
340 |
|
|
my $text_buffer = $tview->get_buffer;
|
341 |
|
|
my $txt=$text_buffer->get_text($text_buffer->get_bounds, TRUE);
|
342 |
|
|
if(length ($txt) >0 ){
|
343 |
|
|
my $buf=$self->object_get_attribute("SEND","TXT_$index");
|
344 |
|
|
$txt= $buf.$txt if(length $buf);
|
345 |
|
|
$self->object_add_attribute("SEND","TXT_$index",$txt);
|
346 |
|
|
set_gui_status($self,"REF_SEND",1);
|
347 |
|
|
|
348 |
|
|
}
|
349 |
|
|
});
|
350 |
|
|
|
351 |
|
|
|
352 |
|
|
return ($scrolled_win,$tview);
|
353 |
|
|
}
|
354 |
|
|
|
355 |
|
|
|
356 |
|
|
|
357 |
|
|
sub check_jtag_connect {
|
358 |
|
|
my ($self,$pipe,$tview,$in, $out, $err,$pipe_name)=@_;
|
359 |
|
|
my $run =$self->object_get_attribute("CTRL","RUN");
|
360 |
|
|
my $connect = $self->object_get_attribute("CTRL","CONNECT");
|
361 |
|
|
my $disconnect = $self->object_get_attribute("CTRL","DISCONNECT");
|
362 |
|
|
|
363 |
|
|
|
364 |
|
|
|
365 |
|
|
my $r;
|
366 |
|
|
if($connect){
|
367 |
|
|
|
368 |
|
|
$r=start_xsct($self,$pipe,$tview,$in, $out, $err) if($pipe_name eq 'xsct' );
|
369 |
|
|
$r=start_stp ($self,$pipe,$tview,$in, $out, $err) if($pipe_name eq 'stp' );
|
370 |
|
|
if($r){
|
371 |
|
|
$self->object_add_attribute("CTRL","RUN",'ON');
|
372 |
|
|
add_info($tview,"Connected!\n");
|
373 |
|
|
set_gui_status($self,"ref",1);
|
374 |
|
|
|
375 |
|
|
|
376 |
|
|
}else{
|
377 |
|
|
$self->object_add_attribute("CTRL","RUN",'OFF');
|
378 |
|
|
add_colored_info($tview,"failed to connect!\n",'red');
|
379 |
|
|
set_gui_status($self,"ref",1);
|
380 |
|
|
|
381 |
|
|
}
|
382 |
|
|
$self->object_add_attribute("CTRL","CONNECT",0);
|
383 |
|
|
}if($disconnect){
|
384 |
|
|
close_xsct($self,$pipe,$tview,$in, $out, $err) if($pipe_name eq 'xsct' );
|
385 |
|
|
close_stp ($self,$pipe,$tview,$in, $out, $err) if($pipe_name eq 'stp' );
|
386 |
|
|
$self->object_add_attribute("CTRL","RUN",'OFF');
|
387 |
|
|
$self->object_add_attribute("CTRL","DISCONNECT",0);
|
388 |
|
|
add_info($tview,"disconnected!\n");
|
389 |
|
|
set_gui_status($self,"ref",1);
|
390 |
|
|
}
|
391 |
|
|
}
|
392 |
|
|
|
393 |
|
|
|
394 |
|
|
use constant UART_UPDATE_WB_ADDR => 7;
|
395 |
|
|
use constant UART_UPDATE_WB_WR_DATA=> 6;
|
396 |
|
|
use constant UART_UPDATE_WB_RD_DATA => 5;
|
397 |
|
|
|
398 |
|
|
# Converts pairs of hex digits to asci
|
399 |
|
|
sub hex_to_ascii { # $ascii ($hex)
|
400 |
|
|
my $s = shift;
|
401 |
|
|
|
402 |
|
|
return pack 'H*', $s;
|
403 |
|
|
}
|
404 |
|
|
|
405 |
|
|
|
406 |
|
|
|
407 |
|
|
sub nop{
|
408 |
|
|
#no oprtstion
|
409 |
|
|
return
|
410 |
|
|
}
|
411 |
|
|
##########
|
412 |
|
|
# Quartus stp
|
413 |
|
|
##########
|
414 |
|
|
|
415 |
|
|
|
416 |
|
|
sub run_stp_pipe{
|
417 |
|
|
my ($self,$pipe,$in,$out,$err,$tview)=@_;
|
418 |
|
|
$$out='';
|
419 |
|
|
$$in .= "puts done\n";
|
420 |
|
|
|
421 |
|
|
#print $$in;
|
422 |
|
|
|
423 |
|
|
pump $$pipe while (length $$in);
|
424 |
|
|
until ($$out =~ /done/ || (length $$err)){
|
425 |
|
|
|
426 |
|
|
pump $$pipe;
|
427 |
|
|
refresh_gui();
|
428 |
|
|
}
|
429 |
|
|
if(length $$err){
|
430 |
|
|
add_colored_info($tview,"Got an Error: $$err\n",'red');
|
431 |
|
|
$self->object_add_attribute("CTRL","DISCONNECT",1);
|
432 |
|
|
set_gui_status($self,"ON-OFF",0);
|
433 |
|
|
return 0;
|
434 |
|
|
}
|
435 |
|
|
# stp does not print on stderr. we need to check stdout manually for error
|
436 |
|
|
my @error_list=("ERROR:","can't read");
|
437 |
|
|
foreach my $err (@error_list) {
|
438 |
|
|
if( $$out =~ /$err/){
|
439 |
|
|
add_colored_info($tview,"Got an Error: $$out\n",'red');
|
440 |
|
|
$self->object_add_attribute("CTRL","DISCONNECT",1);
|
441 |
|
|
set_gui_status($self,"ON-OFF",0);
|
442 |
|
|
return 0;
|
443 |
|
|
}
|
444 |
|
|
|
445 |
|
|
}
|
446 |
|
|
|
447 |
|
|
refresh_gui();
|
448 |
|
|
#print $$out;
|
449 |
|
|
return 1;
|
450 |
|
|
}
|
451 |
|
|
|
452 |
|
|
sub start_stp{
|
453 |
|
|
my ($self,$pipe,$tview,$in, $out, $err)=@_;
|
454 |
|
|
|
455 |
|
|
|
456 |
|
|
my $stp = which('quartus_stp');
|
457 |
|
|
|
458 |
|
|
#check if $xsct exits
|
459 |
|
|
unless(-f $stp){
|
460 |
|
|
add_colored_info($tview,"Error quartus_stp not found. Please add the path to QuartusII/bin to your \$PATH environment\n",'red');
|
461 |
|
|
return 0;
|
462 |
|
|
}
|
463 |
|
|
my @run = ( "$stp" );
|
464 |
|
|
my @run_args = ( "-s" );
|
465 |
|
|
|
466 |
|
|
my $r;
|
467 |
|
|
|
468 |
|
|
$$pipe =start [@run, @run_args], $in, $out, $err or $r=$?;
|
469 |
|
|
if(defined $r){
|
470 |
|
|
add_colored_info($tview," quartus_stp got an Error: $r\n",'red');
|
471 |
|
|
return 0;
|
472 |
|
|
}
|
473 |
|
|
|
474 |
|
|
my $hdw= $self->object_get_attribute('CTRL','quartus_hardware');
|
475 |
|
|
my $dev= $self->object_get_attribute('CTRL','quartus_device');
|
476 |
|
|
|
477 |
|
|
$hdw="" if(!defined $hdw);
|
478 |
|
|
$dev="" if(!defined $dev);
|
479 |
|
|
|
480 |
|
|
|
481 |
|
|
if(length ($hdw) ==0){
|
482 |
|
|
add_colored_info($tview,"Error: Cannot initial the quartus_stp. the hardware name is not defined!\n",'red');
|
483 |
|
|
return 0;
|
484 |
|
|
}
|
485 |
|
|
|
486 |
|
|
if(length ($dev)==0) {
|
487 |
|
|
add_colored_info($tview,"Error: Cannot initial the quartus_stp. the device number is not defined!\n",'red');
|
488 |
|
|
return 0;
|
489 |
|
|
}
|
490 |
|
|
|
491 |
|
|
my $HARDWARE_NAME="$hdw *";
|
492 |
|
|
my $DEVICE_NAME="\@$dev*";
|
493 |
|
|
|
494 |
|
|
|
495 |
|
|
$$in = " ";
|
496 |
|
|
|
497 |
|
|
return 0 unless run_stp_pipe($self,$pipe,$in,$out,$err,$tview);
|
498 |
|
|
$$in = " foreach name [get_hardware_names] {
|
499 |
|
|
if { [string match \"*${HARDWARE_NAME}*\" \$name] } {
|
500 |
|
|
set hardware_name \$name\n
|
501 |
|
|
}
|
502 |
|
|
}
|
503 |
|
|
puts \"\\nhardware_name is \$hardware_name\"
|
504 |
|
|
foreach name [get_device_names -hardware_name \$hardware_name] {
|
505 |
|
|
if { [string match \"*$DEVICE_NAME*\" \$name] } {
|
506 |
|
|
set chip_name \$name
|
507 |
|
|
}
|
508 |
|
|
}
|
509 |
|
|
puts \"device_name is \$chip_name\\n\";
|
510 |
|
|
open_device -hardware_name \$hardware_name -device_name \$chip_name\n";
|
511 |
|
|
return 0 unless run_stp_pipe($self,$pipe,$in,$out,$err,$tview);
|
512 |
|
|
|
513 |
|
|
return 1;
|
514 |
|
|
}
|
515 |
|
|
|
516 |
|
|
sub close_stp{
|
517 |
|
|
my ($self,$pipe,$tview,$in, $out, $err)=@_;
|
518 |
|
|
$$in =
|
519 |
|
|
"device_unlock
|
520 |
|
|
close_device
|
521 |
|
|
exit
|
522 |
|
|
";
|
523 |
|
|
pump $$pipe while (length $$in);
|
524 |
|
|
finish $$pipe;
|
525 |
|
|
}
|
526 |
|
|
|
527 |
|
|
|
528 |
|
|
sub stp_jtag_vir {
|
529 |
|
|
my ($index,$ir)=@_;
|
530 |
|
|
my $hex = sprintf("%X", $ir);
|
531 |
|
|
my $in =
|
532 |
|
|
"device_lock -timeout 10000
|
533 |
|
|
device_virtual_ir_shift -instance_index $index -ir_value $hex -no_captured_ir_value
|
534 |
|
|
catch {device_unlock}
|
535 |
|
|
";
|
536 |
|
|
return $in;
|
537 |
|
|
}
|
538 |
|
|
|
539 |
|
|
|
540 |
|
|
sub stp_jtag_vdr{
|
541 |
|
|
my ($index,$dat,$width)=@_;
|
542 |
|
|
my $digits= $width>>2;
|
543 |
|
|
my $hex = sprintf("%0${digits}X", $dat);
|
544 |
|
|
my $in=
|
545 |
|
|
"device_lock -timeout 10000
|
546 |
|
|
set data [device_virtual_dr_shift -dr_value $hex -instance_index $index -length $width -value_in_hex]
|
547 |
|
|
catch {device_unlock}
|
548 |
|
|
puts R:\$data:R
|
549 |
|
|
";
|
550 |
|
|
return $in;
|
551 |
|
|
}
|
552 |
|
|
|
553 |
|
|
|
554 |
|
|
sub run_stp_jtag_scaner{
|
555 |
|
|
my ($self,$tview,$tv_ref,$pipe,$in, $out, $err)=@_;
|
556 |
|
|
|
557 |
|
|
my $num = $self->object_get_attribute('CTRL','UART_NUM');
|
558 |
|
|
|
559 |
|
|
|
560 |
|
|
my @tviews=@{$tv_ref};
|
561 |
|
|
|
562 |
|
|
for (my $i=0; $i<$num; $i+=1){
|
563 |
|
|
my $index= $self->object_get_attribute("CTRL","INDEX_$i");
|
564 |
|
|
next if (!defined $index);
|
565 |
|
|
|
566 |
|
|
|
567 |
|
|
|
568 |
|
|
my $txt= $self->object_get_attribute("SEND","TXT_$index");
|
569 |
|
|
my $send_char =0;
|
570 |
|
|
my $l=length $txt;
|
571 |
|
|
if ($l){
|
572 |
|
|
$send_char = substr $txt, 0,1;
|
573 |
|
|
$send_char = ord($send_char); #convert a character to a number
|
574 |
|
|
$txt = substr $txt, 1,$l;
|
575 |
|
|
$self->object_add_attribute("SEND","TXT_$index",$txt );
|
576 |
|
|
}
|
577 |
|
|
|
578 |
|
|
|
579 |
|
|
|
580 |
|
|
#select instruction
|
581 |
|
|
$$in=stp_jtag_vir ($index,UART_UPDATE_WB_RD_DATA);
|
582 |
|
|
return unless run_stp_pipe($self,$pipe,$in,$out,$err,$tview);
|
583 |
|
|
|
584 |
|
|
|
585 |
|
|
#read uart reg 0
|
586 |
|
|
my $str=stp_jtag_vdr ($index,$send_char,32);
|
587 |
|
|
$$in=$str;
|
588 |
|
|
nop();
|
589 |
|
|
return unless run_stp_pipe($self,$pipe,$in,$out,$err,$tview);
|
590 |
|
|
nop();
|
591 |
|
|
my ($tmp,$hex)= sscanf("%sR:%s:R",$$out);
|
592 |
|
|
#print "capture $hex\n";
|
593 |
|
|
my $char= substr($hex, -2);
|
594 |
|
|
#print "char = $char\n";
|
595 |
|
|
if($char ne '00'){
|
596 |
|
|
$char =hex_to_ascii($char);
|
597 |
|
|
add_info($tviews[$i],$char) if(defined $tviews[$i]);
|
598 |
|
|
}
|
599 |
|
|
}
|
600 |
|
|
}
|
601 |
|
|
|
602 |
|
|
|
603 |
|
|
###############
|
604 |
|
|
# xsct
|
605 |
|
|
##############
|
606 |
|
|
|
607 |
|
|
use constant UPDATE_INDEX => "01";
|
608 |
|
|
use constant UPDATE_IR => "02";
|
609 |
|
|
use constant UPDATE_DAT => "04";
|
610 |
|
|
|
611 |
|
|
#USER1 000010 Access user-defined register 1.
|
612 |
|
|
#USER2 000011 Access user-defined register 2.
|
613 |
|
|
#USER3 100010 Access user-defined register 3.
|
614 |
|
|
#USER4 100011 Access user-defined register 4
|
615 |
|
|
|
616 |
|
|
sub run_xsct_pipe{
|
617 |
|
|
my ($self,$pipe,$in,$out,$err,$tview)=@_;
|
618 |
|
|
$$out='';
|
619 |
|
|
$$in .= "puts done\n";
|
620 |
|
|
|
621 |
|
|
pump $$pipe while (length $$in);
|
622 |
|
|
until ($$out =~ /done/ || (length $$err)){
|
623 |
|
|
|
624 |
|
|
pump $$pipe;
|
625 |
|
|
refresh_gui();
|
626 |
|
|
}
|
627 |
|
|
if(length $$err){
|
628 |
|
|
add_colored_info($tview,"Got an Error: $$err\n",'red');
|
629 |
|
|
$self->object_add_attribute("CTRL","DISCONNECT",1);
|
630 |
|
|
set_gui_status($self,"ON-OFF",0);
|
631 |
|
|
return 0;
|
632 |
|
|
}
|
633 |
|
|
refresh_gui();
|
634 |
|
|
|
635 |
|
|
return 1;
|
636 |
|
|
}
|
637 |
|
|
|
638 |
|
|
|
639 |
|
|
sub start_xsct{
|
640 |
|
|
my ($self,$pipe,$tview,$in, $out, $err)=@_;
|
641 |
|
|
|
642 |
|
|
|
643 |
|
|
my $xsct = which('xsct');
|
644 |
|
|
|
645 |
|
|
#check if $xsct exits
|
646 |
|
|
unless(-f $xsct){
|
647 |
|
|
add_colored_info($tview,"Error xsct not found. Please add the path to xilinx/SDK/bin to your \$PATH environment\n",'red');
|
648 |
|
|
return 0;
|
649 |
|
|
}
|
650 |
|
|
my @cat = ( $xsct );
|
651 |
|
|
my $r;
|
652 |
|
|
|
653 |
|
|
$$pipe =start \@cat, $in, $out, $err or $r=$?;
|
654 |
|
|
if(defined $r){
|
655 |
|
|
add_colored_info($tview,"XSCT got an Error: $r\n",'red');
|
656 |
|
|
return 0;
|
657 |
|
|
}
|
658 |
|
|
|
659 |
|
|
|
660 |
|
|
my $target= $self->object_get_attribute('CTRL','JTAG_TARGET');
|
661 |
|
|
|
662 |
|
|
$$in = "";
|
663 |
|
|
return 0 unless run_xsct_pipe($self,$pipe,$in,$out,$err,$tview);
|
664 |
|
|
$$in = "set jseq [jtag sequence]\n connect\n jtag targets $target\n";
|
665 |
|
|
return 0 unless run_xsct_pipe($self,$pipe,$in,$out,$err,$tview);
|
666 |
|
|
|
667 |
|
|
return 1;
|
668 |
|
|
}
|
669 |
|
|
|
670 |
|
|
|
671 |
|
|
|
672 |
|
|
|
673 |
|
|
sub close_xsct{
|
674 |
|
|
my ($self,$pipe,$tview,$in, $out, $err)=@_;
|
675 |
|
|
$$in = "exit\n";
|
676 |
|
|
pump $$pipe while (length $$in);
|
677 |
|
|
finish $$pipe;
|
678 |
|
|
}
|
679 |
|
|
|
680 |
|
|
|
681 |
|
|
sub jtag_reorder{
|
682 |
|
|
my ( $string_in ) =@_;
|
683 |
|
|
my @chars =( $string_in =~ m/../g );#split a string into chunks of two characters
|
684 |
|
|
return join("", reverse @chars);
|
685 |
|
|
}
|
686 |
|
|
|
687 |
|
|
|
688 |
|
|
|
689 |
|
|
sub xsct_send_to_jtag{
|
690 |
|
|
my ($hex,$width,$chain) =@_;
|
691 |
|
|
my $siz = $width+4;
|
692 |
|
|
#print "$chain\n";
|
693 |
|
|
my $str="\$jseq clear
|
694 |
|
|
\$jseq irshift -state IDLE -hex 6 $chain
|
695 |
|
|
\$jseq drshift -state IDLE -hex $siz $hex
|
696 |
|
|
\$jseq run
|
697 |
|
|
";
|
698 |
|
|
return $str;
|
699 |
|
|
}
|
700 |
|
|
|
701 |
|
|
|
702 |
|
|
sub xsct_send_capture_jtag {
|
703 |
|
|
my ($hex,$width,$chain) =@_;
|
704 |
|
|
my $siz = $width+4;
|
705 |
|
|
my $str="\$jseq clear
|
706 |
|
|
\$jseq irshift -state IDLE -hex 6 $chain
|
707 |
|
|
\$jseq drshift -state IDLE -capture -hex $siz $hex
|
708 |
|
|
set data [\$jseq run]
|
709 |
|
|
puts R:\$data:R
|
710 |
|
|
";
|
711 |
|
|
return $str;
|
712 |
|
|
}
|
713 |
|
|
|
714 |
|
|
|
715 |
|
|
sub xsct_jtag_vdr{
|
716 |
|
|
my ($dat,$width,$chain)=@_;
|
717 |
|
|
my $digits= $width>>2;
|
718 |
|
|
my $hex = UPDATE_DAT.sprintf("%0${digits}X", $dat);
|
719 |
|
|
$hex=jtag_reorder($hex);
|
720 |
|
|
return xsct_send_capture_jtag($hex,$width,$chain);
|
721 |
|
|
}
|
722 |
|
|
|
723 |
|
|
|
724 |
|
|
sub xsct_jtag_vir {
|
725 |
|
|
my ($ir,$width,$chain)=@_;
|
726 |
|
|
my $digits= $width>>2;
|
727 |
|
|
my $hex = UPDATE_IR.sprintf("%0${digits}X", $ir);
|
728 |
|
|
$hex=jtag_reorder($hex);
|
729 |
|
|
return xsct_send_to_jtag($hex,$width,$chain);
|
730 |
|
|
}
|
731 |
|
|
|
732 |
|
|
sub xsct_jtag_vindex {
|
733 |
|
|
my ($index,$width,$chain)=@_;
|
734 |
|
|
my $digits= $width>>2;
|
735 |
|
|
my $hex = UPDATE_INDEX.sprintf("%0${digits}X", $index);
|
736 |
|
|
$hex=jtag_reorder($hex);
|
737 |
|
|
return xsct_send_to_jtag($hex,$width,$chain);
|
738 |
|
|
}
|
739 |
|
|
|
740 |
|
|
sub run_xsct_jtag_scaner{
|
741 |
|
|
my ($self,$tview,$tv_ref,$pipe,$in, $out, $err)=@_;
|
742 |
|
|
|
743 |
|
|
my $num = $self->object_get_attribute('CTRL','UART_NUM');
|
744 |
|
|
my $chain= $self->object_get_attribute('CTRL','JTAG_CHAIN');
|
745 |
|
|
my $chain_code=
|
746 |
|
|
($chain==1)? '02':
|
747 |
|
|
($chain==2)? '03':
|
748 |
|
|
($chain==3)? '22':
|
749 |
|
|
'23';
|
750 |
|
|
|
751 |
|
|
my @tviews=@{$tv_ref};
|
752 |
|
|
|
753 |
|
|
for (my $i=0; $i<$num; $i+=1){
|
754 |
|
|
my $index= $self->object_get_attribute("CTRL","INDEX_$i");
|
755 |
|
|
next if (!defined $index);
|
756 |
|
|
my $txt= $self->object_get_attribute("SEND","TXT_$index");
|
757 |
|
|
my $send_char =0;
|
758 |
|
|
my $l=length $txt;
|
759 |
|
|
if ($l){
|
760 |
|
|
$send_char = substr $txt, 0,1;
|
761 |
|
|
$send_char = ord($send_char); #convert a character to a number
|
762 |
|
|
$txt = substr $txt, 1,$l;
|
763 |
|
|
$self->object_add_attribute("SEND","TXT_$index",$txt );
|
764 |
|
|
}
|
765 |
|
|
|
766 |
|
|
|
767 |
|
|
#select index
|
768 |
|
|
#print"select index\n";
|
769 |
|
|
$$in=xsct_jtag_vindex ($index,32,$chain_code);
|
770 |
|
|
return unless run_xsct_pipe($self,$pipe,$in,$out,$err,$tview);
|
771 |
|
|
|
772 |
|
|
|
773 |
|
|
#select instruction
|
774 |
|
|
#print"select instruction\n";
|
775 |
|
|
$$in=xsct_jtag_vir (UART_UPDATE_WB_RD_DATA,32,$chain_code);
|
776 |
|
|
return unless run_xsct_pipe($self,$pipe,$in,$out,$err,$tview);
|
777 |
|
|
|
778 |
|
|
|
779 |
|
|
#read uart reg 0
|
780 |
|
|
#print"read reg 0\n";
|
781 |
|
|
my $str=xsct_jtag_vdr ($send_char,32,$chain_code);
|
782 |
|
|
$$in=$str;
|
783 |
|
|
nop();
|
784 |
|
|
return unless run_xsct_pipe($self,$pipe,$in,$out,$err,$tview);
|
785 |
|
|
nop();
|
786 |
|
|
my ($hex)= sscanf("R:%s:R",$$out);
|
787 |
|
|
my $char= substr $hex, 0, 2;
|
788 |
|
|
if($char ne '00'){
|
789 |
|
|
$char =hex_to_ascii(substr $hex, 0, 2);
|
790 |
|
|
add_info($tviews[$i],$char) if(defined $tviews[$i]);
|
791 |
|
|
}
|
792 |
|
|
|
793 |
|
|
|
794 |
|
|
|
795 |
|
|
}
|
796 |
|
|
}
|
797 |
|
|
|
798 |
|
|
|
799 |
|
|
|
800 |
|
|
|
801 |
|
|
############
|
802 |
|
|
# main
|
803 |
|
|
############
|
804 |
|
|
|
805 |
|
|
|
806 |
|
|
|
807 |
|
|
sub uart_main {
|
808 |
|
|
my $self = __PACKAGE__->new();
|
809 |
|
|
set_gui_status($self,"ideal",0);
|
810 |
|
|
my $window = def_popwin_size (85,85,'UART Terminal','percent');
|
811 |
|
|
my ($sw,$tview) =create_txview();# a textveiw for showing the info, erro messages etc
|
812 |
|
|
my $ctrl= ctrl_boxes($self,$tview);
|
813 |
|
|
my ($rsv,$tv_ref) = receive_boxes($self);
|
814 |
|
|
my ($send,$send_tv) = sender_box($self,$tview);
|
815 |
|
|
|
816 |
|
|
my $v1 = gen_vpaned ($ctrl,0.3,$send);
|
817 |
|
|
my $v2 = gen_vpaned ($v1,0.5,$sw);
|
818 |
|
|
my $h1 = gen_hpaned ($rsv,0.55,$v2);
|
819 |
|
|
|
820 |
|
|
my ($pipe,$in, $out, $err);
|
821 |
|
|
my $counter=5;
|
822 |
|
|
#check soc status every 0.5 second. referesh device table if there is any changes
|
823 |
|
|
Glib::Timeout->add (10, sub{
|
824 |
|
|
my ($state,$timeout)= get_gui_status($self);
|
825 |
|
|
|
826 |
|
|
if ($timeout>0){
|
827 |
|
|
$timeout--;
|
828 |
|
|
set_gui_status($self,$state,$timeout);
|
829 |
|
|
}
|
830 |
|
|
elsif( $state ne "ideal" ){
|
831 |
|
|
if($state eq 'ref_all') {
|
832 |
|
|
$rsv->destroy();
|
833 |
|
|
($rsv,$tv_ref) = receive_boxes($self);
|
834 |
|
|
$h1-> pack1($rsv, TRUE, TRUE);
|
835 |
|
|
}
|
836 |
|
|
|
837 |
|
|
|
838 |
|
|
|
839 |
|
|
$ctrl->destroy();
|
840 |
|
|
$send->destroy();
|
841 |
|
|
|
842 |
|
|
($send,$send_tv) = sender_box($self,$tview);
|
843 |
|
|
$ctrl= ctrl_boxes($self,$tview);
|
844 |
|
|
|
845 |
|
|
$v1-> pack1($ctrl, TRUE, TRUE);
|
846 |
|
|
$v1-> pack2($send, TRUE, TRUE);
|
847 |
|
|
$h1->show_all();
|
848 |
|
|
set_gui_status($self,"ideal",0);
|
849 |
|
|
if($state eq 'ON-OFF') {
|
850 |
|
|
my $uname= $self->object_get_attribute('CTRL','UART_NAME');
|
851 |
|
|
my $pipe_name = ($uname eq 'ProNoC_XILINX_UART') ? 'xsct' : 'stp';
|
852 |
|
|
check_jtag_connect ($self,\$pipe,$tview,\$in, \$out, \$err,$pipe_name);
|
853 |
|
|
my $st =$self->object_get_attribute("CTRL","RUN");
|
854 |
|
|
$counter=5 if ($st eq 'OFF');
|
855 |
|
|
#print "ON-OFF\n";
|
856 |
|
|
}
|
857 |
|
|
# print "ref\n";
|
858 |
|
|
|
859 |
|
|
|
860 |
|
|
}
|
861 |
|
|
my $st =$self->object_get_attribute("CTRL","RUN");
|
862 |
|
|
$counter-- if ($st eq 'ON' && $counter>0);
|
863 |
|
|
if($counter ==0 ){
|
864 |
|
|
my $uname= $self->object_get_attribute('CTRL','UART_NAME');
|
865 |
|
|
run_xsct_jtag_scaner($self,$tview,$tv_ref,\$pipe,\$in, \$out, \$err) if($uname eq 'ProNoC_XILINX_UART' );
|
866 |
|
|
run_stp_jtag_scaner($self,$tview,$tv_ref,\$pipe,\$in, \$out, \$err) if($uname eq 'ProNoC_ALTERA_UART' );
|
867 |
|
|
}
|
868 |
|
|
return TRUE;
|
869 |
|
|
|
870 |
|
|
} );
|
871 |
|
|
|
872 |
|
|
|
873 |
|
|
$window->add($h1);
|
874 |
|
|
$window->show_all();
|
875 |
|
|
return $window;
|
876 |
|
|
}
|
877 |
|
|
|
878 |
|
|
|
879 |
|
|
|
880 |
|
|
|
881 |
|
|
|
882 |
|
|
|
883 |
|
|
1;
|