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
Compare Revisions
- This comparison shows the changes necessary to convert path
/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk/mpsoc/perl_gui/lib
- from Rev 23 to Rev 24
- ↔ Reverse comparison
Rev 23 → Rev 24
/perl/hdr_file_gen.pl
13,9 → 13,56
|
|
|
sub get_instance_global_variable{ |
my ($soc,$id) = @_; |
my $module =$soc->soc_get_module($id); |
my $module_name =$soc->soc_get_module_name($id); |
my $category =$soc->soc_get_category($id); |
my $inst =$soc->soc_get_instance_name($id); |
my @plugs= $soc->soc_get_all_plugs_of_an_instance($id); |
my %params= $soc->soc_get_module_param($id); |
#add two extra variable the instance name and base addresses |
$params{IP}=$inst; |
$params{CORE}=$id; |
foreach my $plug (@plugs){ |
my @nums=$soc->soc_list_plug_nums($id,$plug); |
foreach my $num (@nums){ |
my ($addr,$base,$end,$name,$connect_id,$connect_socket,$connect_socket_num)=$soc->soc_get_plug($id,$plug,$num); |
#wishbone slave address |
if((defined $connect_socket) && ($connect_socket eq 'wb_slave')){ |
#print "$addr,$base,$end,$connect_id,$connect_socket,$connect_socket_num\n"; |
my $base_hex=sprintf("0X%08x", $base); |
my $end_hex=sprintf("0X%08x", $end); |
my $val="BASE".$num; |
$params{$val}=$base_hex; |
|
} |
|
|
} |
} |
$params{BASE}=$params{BASE0} if(defined $params{BASE0}); |
|
|
return (\%params); |
} |
|
|
sub replace_golb_var{ |
my ($hdr,$ref)=@_; |
my %params= %{$ref}; |
foreach my $p (sort keys %params){ |
my $pattern= '\$\{?' . $p . '(\}|\b)'; |
($hdr=$hdr)=~s/$pattern/$params{$p}/g; |
} |
return $hdr; |
|
} |
|
|
|
sub generate_header_file{ |
my ($soc)= @_; |
my ($soc,$project_dir,$target_dir,$dir)= @_; |
my $soc_name=$soc->soc_get_soc_name(); |
$soc_name = uc($soc_name); |
if(!defined $soc_name){$soc_name='soc'}; |
33,27 → 80,20
my $module_name =$soc->soc_get_module_name($id); |
my $category =$soc->soc_get_category($id); |
my $inst =$soc->soc_get_instance_name($id); |
|
|
add_text_to_string(\$system_h,"\n \n /* $inst */ \n"); |
$inst=uc($inst); |
# print base address |
my @plugs= $soc->soc_get_all_plugs_of_an_instance($id); |
|
|
my %params= %{get_instance_global_variable($soc,$id)}; |
|
|
foreach my $plug (@plugs){ |
my @nums=$soc->soc_list_plug_nums($id,$plug); |
foreach my $num (@nums){ |
my ($addr,$base,$end,$name,$connect_id,$connect_socket,$connect_socket_num)=$soc->soc_get_plug($id,$plug,$num); |
#wishbone slave address |
if((defined $connect_socket) && ($connect_socket eq 'wb_slave')){ |
|
#print "$addr,$base,$end,$connect_id,$connect_socket,$connect_socket_num\n"; |
my $base_hex=sprintf("0X%08x", $base); |
my $end_hex=sprintf("0X%08x", $end); |
|
add_text_to_string(\$system_h,"#define $inst\_BASE_ADDR$num \t\t $base_hex\n"); |
add_text_to_string(\$system_h,"#define $inst\_BASE_ADDR \t\t $inst\_BASE_ADDR0\n") if ($num==0); |
|
|
} |
#intrrupt |
if((defined $connect_socket) && ($connect_socket eq 'interrupt_peripheral')){ |
add_text_to_string(\$system_h,"//intrrupt flag location\n"); |
65,27 → 105,52
} |
|
|
my $hdr =$ip->ip_get_hdr($category,$module); |
my $hdr =$ip->ip_get($category,$module,"system_h"); |
#print "$hdr"; |
|
|
# \$\{?IP(\b|\}) |
if(defined $hdr){ |
#replace IP name |
my $key='\$IP\\\\'; |
($hdr=$hdr)=~s/$key/$inst/g; |
$hdr=replace_golb_var($hdr,\%params); |
add_text_to_string(\$system_h,"$hdr\n"); |
} |
|
$key='\$IP'; |
($hdr=$hdr)=~s/$key/$inst/g; |
# Write Software gen files |
my @sw_file_gen = $ip->ip_get_list($category,$module,"gen_sw_files"); |
foreach my $file (@sw_file_gen){ |
if(defined $file ){ |
my ($path,$rename)=split('frename_sep_t',$file); |
$rename=replace_golb_var($rename,\%params); |
#read the file content |
my $content=read_file_cntent($path,$project_dir); |
$content=replace_golb_var($content,\%params); |
|
|
if(defined $rename){ |
|
#replace BASE addr |
$key='\$BASE'; |
($hdr=$hdr)=~s/$key/$inst\_BASE_ADDR/g; |
|
add_text_to_string(\$system_h,"$hdr\n"); |
open(FILE, ">lib/verilog/$rename") || die "Can not open: $!"; |
print FILE $content; |
close(FILE) || die "Error closing file: $!"; |
move ("$dir/lib/verilog/$rename","$target_dir/sw/"); |
|
|
} |
} |
} |
|
|
} |
|
add_text_to_string(\$system_h,"#endif\n"); |
return $system_h; |
my $name=$soc->soc_get_soc_name(); |
open(FILE, ">lib/verilog/$name.h") || die "Can not open: $!"; |
print FILE $system_h; |
close(FILE) || die "Error closing file: $!"; |
move ("$dir/lib/verilog/$name.h","$target_dir/sw/"); |
|
|
|
|
} |
|
|
/perl/temp.pl
1,58 → 1,160
#! /usr/bin/perl -w |
|
use Glib qw/TRUE FALSE/; |
use Gtk2 '-init'; |
|
use strict; |
use warnings; |
our $spinner1; |
|
sub get_value |
{ |
my ($button, $format) = @_; |
|
if ('int' eq $format) |
{ |
$button->{val_label}->set_text (sprintf ("%d", |
$spinner1->get_value_as_int)); |
} |
else |
{ |
$button->{val_label}->set_text (sprintf ("%0.*f", |
$spinner1->get_digits, |
$spinner1->get_value)); |
} |
} |
|
$window = Gtk2::Window->new ('toplevel'); |
$window->signal_connect (destroy => sub { Gtk2->main_quit; 0; }); |
$window->set_title ("Spin Button"); |
|
$main_vbox = Gtk2::VBox->new (FALSE, 5); |
$main_vbox->set_border_width (10); |
$window->add ($main_vbox); |
|
my @nums=(0,2,3,6,7); |
$frame = Gtk2::Frame->new ("Not accelerated"); |
$main_vbox->pack_start ($frame, TRUE, TRUE, 0); |
|
my $s=compress_nums(@nums); |
$vbox = Gtk2::VBox->new (FALSE, 0); |
$vbox->set_border_width (10); |
$frame->add ($vbox); |
|
print "$s\n"; |
# Day, month, year spinners |
$hbox = Gtk2::HBox->new (FALSE, 0); |
$vbox->pack_start ($hbox, TRUE, TRUE, 5); |
|
$vbox2 = Gtk2::VBox->new (FALSE, 0); |
$hbox->pack_start ($vbox2, TRUE, TRUE, 5); |
|
sub compress_nums{ |
my @nums=@_; |
my @f=sort { $a <=> $b } @nums; |
my $s; |
my $ls; |
my $range=0; |
my $x; |
|
$label = Gtk2::Label->new ("Day :"); |
$label->set_alignment (0.0, 0.5); # left halignment, middle valignment |
$vbox2->pack_start ($label, FALSE, TRUE, 0); |
|
foreach my $p (@f){ |
if(!defined $x) { |
$s="$p"; |
$ls=$p; |
|
} |
else{ |
if($p-$x>1){ #gap exist |
if( $range){ |
$s=($x-$ls>1 )? "$s:$x,$p": "$s,$x,$p"; |
$ls=$p; |
$range=0; |
}else{ |
$s= "$s,$p"; |
$ls=$p; |
$adj = Gtk2::Adjustment->new (1.0, 1.0, 31.0, 1.0, 5.0, 0.0); |
$spinner = Gtk2::SpinButton->new ($adj, 0, 0); |
$spinner->set_wrap (TRUE); |
$vbox2->pack_start ($spinner, FALSE, TRUE, 0); |
|
} |
|
}else {$range=1;} |
$vbox2 = Gtk2::VBox->new (FALSE, 0); |
$hbox->pack_start ($vbox2, TRUE, TRUE, 5); |
|
$label = Gtk2::Label->new ("Month :"); |
$label->set_alignment (0.0, 0.5); # left halignment, middle valignment |
$vbox2->pack_start ($label, FALSE, TRUE, 0); |
|
|
} |
|
$x=$p |
} |
if($range==1){ $s= ($x-$ls>1 )? "$s:$x": "$s,$x";} |
#update $s($ls,$hs); |
$adj = Gtk2::Adjustment->new (1.0, 1.0, 12.0, 1.0, 5.0, 0.0); |
$spinner = Gtk2::SpinButton->new ($adj, 0, 0); |
$spinner->set_wrap (TRUE); |
$vbox2->pack_start ($spinner, FALSE, TRUE, 0); |
|
return $s; |
|
} |
$vbox2 = Gtk2::VBox->new (FALSE, 0); |
$hbox->pack_start ($vbox2, TRUE, TRUE, 5); |
|
$label = Gtk2::Label->new ("Year :"); |
$label->set_alignment (0.0, 0.5); # left halignment, middle valignment |
$vbox2->pack_start ($label, FALSE, TRUE, 0); |
|
$adj = Gtk2::Adjustment->new (1998.0, 1.0, 2100.0, 1.0, 100.0, 0.0); |
$spinner = Gtk2::SpinButton->new ($adj, 0, 0); |
$spinner->set_wrap (TRUE); |
$spinner->set_size_request (55, -1); |
$vbox2->pack_start ($spinner, FALSE, TRUE, 0); |
|
$frame = Gtk2::Frame->new ("Accelerated"); |
$main_vbox->pack_start ($frame, TRUE, TRUE, 0); |
|
$vbox = Gtk2::VBox->new (FALSE, 0); |
$vbox->set_border_width (5); |
$frame->add ($vbox); |
|
$hbox = Gtk2::HBox->new (FALSE, 0); |
$vbox->pack_start ($hbox, TRUE, TRUE, 5); |
|
$vbox2 = Gtk2::VBox->new (FALSE, 0); |
$hbox->pack_start ($vbox2, TRUE, TRUE, 5); |
|
$label = Gtk2::Label->new ("Value :"); |
$label->set_alignment (0.0, 0.5); # left halignment, middle valignment |
$vbox2->pack_start ($label, FALSE, TRUE, 0); |
|
$adj = Gtk2::Adjustment->new (0.0, -10000.0, 10000.0, 0.5, 100.0, 0.0); |
$spinner1 = Gtk2::SpinButton->new ($adj, 1.0, 2); |
$spinner1->set_wrap (TRUE); |
$spinner1->set_size_request (100, -1); |
$vbox2->pack_start ($spinner1, FALSE, TRUE, 0); |
|
$vbox2 = Gtk2::VBox->new (FALSE, 0); |
$hbox->pack_start ($vbox2, TRUE, TRUE, 5); |
|
$label = Gtk2::Label->new ("Digits :"); |
$label->set_alignment (0.0, 0.5); # left halignment, middle valignment |
$vbox2->pack_start ($label, FALSE, TRUE, 0); |
|
$adj = Gtk2::Adjustment->new (2, 1, 5, 1, 1, 0); |
$spinner2 = Gtk2::SpinButton->new ($adj, 0.0, 0); |
$spinner2->set_wrap (TRUE); |
$adj->signal_connect (value_changed => sub { |
$spinner1->set_digits ($spinner2->get_value_as_int ()); |
}); |
$vbox2->pack_start ($spinner2, FALSE, TRUE, 0); |
|
$button = Gtk2::CheckButton->new ("Snap to 0.5-ticks"); |
$button->signal_connect (clicked => sub { |
$spinner1->set_snap_to_ticks ($_[0]->get_active); |
}); |
$vbox->pack_start ($button, TRUE, TRUE, 0); |
$button->set_active (TRUE); |
|
$button = Gtk2::CheckButton->new ("Numeric only input mode"); |
$button->signal_connect (clicked => sub { |
$spinner1->set_numeric ($_[0]->get_active); |
}); |
$vbox->pack_start ($button, TRUE, TRUE, 0); |
$button->set_active (TRUE); |
|
$val_label = Gtk2::Label->new (""); |
|
$hbox = Gtk2::HBox->new (FALSE, 0); |
$vbox->pack_start ($hbox, FALSE, TRUE, 5); |
$button = Gtk2::Button->new ("Value as Int"); |
$button->{val_label} = $val_label; |
$button->signal_connect (clicked => \&get_value, 'int'); |
$hbox->pack_start ($button, TRUE, TRUE, 5); |
|
$button = Gtk2::Button->new ("Value as Float"); |
$button->{val_label} = $val_label; |
$button->signal_connect (clicked => \&get_value, 'float'); |
$hbox->pack_start ($button, TRUE, TRUE, 5); |
|
$vbox->pack_start ($val_label, TRUE, TRUE, 0); |
$val_label->set_text ("0"); |
|
$hbox = Gtk2::HBox->new (FALSE, 0); |
$main_vbox->pack_start ($hbox, FALSE, TRUE, 0); |
|
$button = Gtk2::Button->new ("Close"); |
$button->signal_connect (clicked => sub { $window->destroy; }); |
$hbox->pack_start ($button, TRUE, TRUE, 0); |
|
$window->show_all; |
|
Gtk2->main; |
|
0; |
/perl/ip.pm
229,20 → 229,7
return @r; |
} |
|
sub get_describtion{ |
my ($self,$category,$module)=@_; |
my $r; |
if (!defined($module) ) {return $r;} |
$r=$self->{categories}{$category}{names}{$module}{Describtion}; |
|
return $r; |
|
} |
|
|
|
|
|
sub get_param_default{ |
my ($self,$category,$module)=@_; |
my %r; |
382,52 → 369,53
} |
|
|
sub ip_get_module_name{ |
my ($self, $category,$module)=@_; |
my $module_name; |
if(exists $self->{categories}{$category}{names}{$module}{module_name}){ |
$module_name= $self->{categories}{$category}{names}{$module}{module_name}; |
} |
return $module_name; |
} |
|
|
sub ip_get_hdr{ |
my ($self, $category,$module)=@_; |
my $hdr; |
if(exists($self->{categories}{$category}{names}{$module}{header})){ |
$hdr=$self->{categories}{$category}{names}{$module}{header}; |
} |
return $hdr; |
|
|
|
sub ip_add{ |
my ($self,$category,$module,$filed_name,$filed_data)=@_; |
$self->{categories}{$category}{names}{$module}{$filed_name}=$filed_data; |
} |
|
|
sub ip_get_files{ |
my ($self, $category,$module,$list_name)=@_; |
sub ip_get{ |
my ($self,$category,$module,$filed_name)=@_; |
return $self->{categories}{$category}{names}{$module}{$filed_name}; |
} |
|
|
sub ip_get_list{ |
my ($self,$category,$module,$filed_name)=@_; |
my @l; |
@l=@{$self->{categories}{$category}{names}{$module}{$list_name}} if(defined $self->{categories}{$category}{names}{$module}{$list_name}); |
return @l; |
if( defined $self->{categories}{$category}{names}{$module}{$filed_name}){ |
@l=@{$self->{categories}{$category}{names}{$module}{$filed_name}}; |
} |
return @l; |
} |
|
|
sub ip_get_unsuded_intfc_ports{ |
my ($self, $category,$module)=@_; |
return $self->{categories}{$category}{names}{$module}{"unused"}; |
|
sub ip_remove{ |
my ($self,$category,$module,$filed_name)=@_; |
delete $self->{categories}{$category}{names}{$module}{$filed_name}; |
} |
|
|
|
|
sub add_ip{ |
|
my ($self,$ipgen) =@_; |
my $module; |
$module = $ipgen->ipgen_get_ip_name(); |
my $module_name =$ipgen->ipgen_get_module_name(); |
$module = $ipgen->ipgen_get("ip_name"); |
my $module_name =$ipgen->ipgen_get("module_name"); |
if(!defined $module){ $module = $module_name} |
my $category= $ipgen->ipgen_get_category(); |
my $Describtion= $ipgen->ipgen_get_description(); |
my $category= $ipgen->ipgen_get("category"); |
|
|
$self->{categories}{$category}{names}{$module}={}; |
$self->{categories}{$category}{names}{$module}{Describtion}=$Describtion; |
|
$self->{categories}{$category}{names}{$module}{module_name}=$module_name; |
my @plugs= $ipgen->ipgen_list_plugs(); |
#print "$module:@plugs\n"; |
450,24 → 438,20
ip_add_parameter($self,$category,$module,$param,$deafult,$type,$content,$info,$glob_param,$redefine_param); |
|
} |
my @params_order= $ipgen->ipgen_get_parameters_order(); |
$self->{categories}{$category}{names}{$module}{parameters_order}=\@params_order; |
|
my @ports= $ipgen->ipgen_list_ports(); |
foreach my $port (@ports){ |
my($range,$type,$intfc_name,$intfc_port)=$ipgen->ipgen_get_port($port); |
ip_add_port($self,$category,$module,$port,$type,$range,$intfc_name,$intfc_port); |
} |
my $hdr= $ipgen->ipgen_get_hdr(); |
$self->{categories}{$category}{names}{$module}{header}=$hdr; |
|
my @hdl_files= $ipgen->ipgen_get_files_list("hdl_files"); |
$self->{categories}{$category}{names}{$module}{"hdl_files"}=\@hdl_files; |
my @fileds =("system_h","hdl_files","sw_files","gen_sw_files","sw_params_list","unused","parameters_order","description"); |
foreach my $p (@fileds){ |
my $val=$ipgen->ipgen_get($p); |
$self->{categories}{$category}{names}{$module}{$p}=$ipgen->ipgen_get($p) if(defined $val ); |
} |
|
my @sw_files= $ipgen->ipgen_get_files_list("sw_files"); |
$self->{categories}{$category}{names}{$module}{"sw_files"}=\@sw_files; |
$self->{categories}{$category}{names}{$module}{"unused"}=$ipgen->ipgen_get_unused_intfc_ports(); |
|
|
|
} |
|
/perl/mpsoc_gen.pl
89,7 → 89,7
$step=~ s/\D//g; |
$widget=gen_spin($min,$max,$step); |
$widget->set_value($value); |
$widget-> signal_connect("changed" => sub{ |
$widget-> signal_connect("value_changed" => sub{ |
my $new_param_value=$widget->get_value_as_int(); |
$mpsoc->mpsoc_add_param($param,$new_param_value); |
set_state($state,"ref",1); |
440,7 → 440,7
my $spin=gen_spin($min,$max,$step); |
$spin->set_value($param_value{$p}); |
$table->attach_defaults ($spin, 3, 4, $row, $row+1); |
$spin-> signal_connect("changed" => sub{$param_value{$p}=$spin->get_value_as_int();}); |
$spin-> signal_connect("value_changed" => sub{$param_value{$p}=$spin->get_value_as_int();}); |
|
# $box=def_label_spin_help_box ($param,$info, $value,$min,$max,$step, 2); |
} |
1131,7 → 1131,7
foreach my $soc_name (@soc_list){ |
my @n=$mpsoc->mpsoc_get_soc_tiles_num($soc_name); |
if(scalar @n){ |
#this soc has been used generate the verilog files of it |
#generate the verilog files of it |
push(@used_socs,$soc_name); |
} |
} |
1222,15 → 1222,12
|
|
# Write header file |
my $file_h=generate_header_file($soc); |
open(FILE, ">lib/verilog/$soc_name.h") || die "Can not open: $!"; |
print FILE $file_h; |
close(FILE) || die "Error closing file: $!"; |
generate_header_file($soc,$project_dir,$target_dir,$dir); |
|
|
|
move ("$dir/lib/verilog/$soc_name.h","$target_dir/sw/"); |
|
|
#use File::Copy::Recursive qw(dircopy); |
#dircopy("$dir/../src_processor/aeMB/compiler","$target_dir/sw/") or die("$!\n"); |
|
/perl/soc_gen.pl
163,7 → 163,7
my $spin=gen_spin($min,$max,$step); |
$spin->set_value($value); |
$table->attach_defaults ($spin, 3, 4, $row, $row+1); |
$spin-> signal_connect("changed" => sub{$new_param_value{$p}=$spin->get_value_as_int();}); |
$spin-> signal_connect("value_changed" => sub{ $new_param_value{$p}=$spin->get_value_as_int(); }); |
|
# $box=def_label_spin_help_box ($param,$info, $value,$min,$max,$step, 2); |
} |
749,7 → 749,7
|
my ($category) = $model->get ($iter, CATRGORY_COLUMN); |
my ($module) = $model->get ($iter,MODULE_COLUMN ); |
my $describ=$ip->get_describtion($category,$module); |
my $describ=$ip->ip_get($category,$module,"description"); |
if($describ){ |
#print "$entry describtion is: $describ \n"; |
show_info($info,$describ); |
818,10 → 818,11
my $category =$soc->soc_get_category($id); |
my $inst =$soc->soc_get_instance_name($id); |
|
my @new=$ip->ip_get_files( $category,$module,$list_name); |
my @new=$ip->ip_get_list( $category,$module,$list_name); |
#print "@new\n"; |
foreach my $f(@new){ |
my $n="$project_dir$f"; |
if (!(-f "$n") && !(-f "$f" ) ){ |
if (!(-f "$n") && !(-f "$f" ) && !(-d "$n") && !(-d "$f" ) ){ |
$warnings=(defined $warnings)? "$warnings WARNING: Can not find \"$f\" which is required for \"$inst\" \n":"WARNING: Can not find \"$f\" which is required for \"$inst\"\n "; |
|
} |
877,17 → 878,8
#copy hdl codes in src_verilog |
|
my ($file_ref,$warnings)= get_all_files_list($soc,"hdl_files"); |
foreach my $f(@{$file_ref}){ |
my $n="$project_dir$f"; |
if (-f "$n") { |
copy ("$n","$target_dir/src_verilog/lib"); |
}elsif(-f "$f" ){ |
copy ("$f","$target_dir/src_verilog/lib"); |
|
} |
|
copy_file_and_folders($file_ref,$project_dir,"$target_dir/src_verilog/lib"); |
|
} |
show_info(\$info,$warnings) if(defined $warnings); |
|
|
907,34 → 899,23
|
|
|
# Write header files |
my $file_h=generate_header_file($soc); |
open(FILE, ">lib/verilog/$name.h") || die "Can not open: $!"; |
print FILE $file_h; |
close(FILE) || die "Error closing file: $!"; |
move ("$dir/lib/verilog/$name.h","$target_dir/sw/"); |
# Write system.h and generated file |
generate_header_file($soc,$project_dir,$target_dir,$dir); |
|
|
# Write Software files |
($file_ref,$warnings)= get_all_files_list($soc,"sw_files"); |
|
copy_file_and_folders($file_ref,$project_dir,"$target_dir/sw"); |
|
# Write Software gen files |
($file_ref,$warnings)= get_all_files_list($soc,"gen_sw_files"); |
foreach my $f(@{$file_ref}){ |
my $name= basename($f); |
#print "$f\n"; |
|
my $n="$project_dir$f"; |
if (-f "$n") { #copy file |
copy ("$n","$target_dir/sw"); |
}elsif(-f "$f" ){ |
copy ("$f","$target_dir/sw"); |
|
}elsif (-d "$n") {#copy folder |
dircopy ("$n","$target_dir/sw/$name"); |
}elsif(-d "$f" ){ |
dircopy ("$f","$target_dir/sw/$name"); |
|
} |
|
|
} |
|
} |
|
|
# Write main.c file if not exist |
my $n="$target_dir/sw/main.c"; |
if (!(-f "$n")) { |
1236,11 → 1217,7
my $info; |
if(is_hex($base_in) && is_hex($end_in)){ |
my $size=(hex ($end_in) >= hex ($base_in))? hex ($end_in) - hex ($base_in) +1 : 0; |
my $size_text= $size==0 ? 'Error': |
$size<(1 << 10)? $size: |
$size<(1 << 20)? join (' ', ($size>>10,"K")) : |
$size<(1 << 30)? join (' ', ($size>>20,"M")) : |
join (' ', ($size>>30,"G")) ; |
my $size_text= metric_conversion($size); |
$label= gen_label_in_center($size_text); |
$$newbase_ref[$number]=hex($base_in); |
$$newend_ref[$number]=hex($end_in); |
/perl/widget.pl
135,8 → 135,19
$box->pack_start( $entry, FALSE, FALSE, 3); |
return ($box,$entry); |
|
} |
} |
|
sub def_h_labeled_entry_help{ |
my ($help,$label_name,$initial)=@_; |
my $box = def_hbox(TRUE,0); |
my $label= gen_label_in_left($label_name); |
my ($b,$entry) =gen_entry_help($help,$initial); |
$box->pack_start( $label, FALSE, FALSE, 3); |
$box->pack_start( $b, FALSE, FALSE, 3); |
return ($box,$entry); |
|
} |
|
############## |
# ComboBoxEntry |
############## |
153,6 → 164,25
return $combo_box_entry; |
} |
|
########### |
# |
########### |
|
sub def_h_labeled_checkbutton{ |
my ($label_name,$status)=@_; |
my $box = def_hbox(TRUE,0); |
my $label= gen_label_in_left($label_name); |
my $check= Gtk2::CheckButton->new; |
#if($status==1) $check-> |
$box->pack_start( $label, FALSE, FALSE, 3); |
$box->pack_start( $check, FALSE, FALSE, 3); |
return ($box,$check); |
|
} |
|
|
|
|
############# |
# label |
############ |
897,4 → 927,62
} |
|
|
sub copy_file_and_folders{ |
my ($file_ref,$project_dir,$target_dir)=@_; |
|
foreach my $f(@{$file_ref}){ |
my $name= basename($f); |
my $n="$project_dir$f"; |
if (-f "$n") { #copy file |
copy ("$n","$target_dir"); |
}elsif(-f "$f" ){ |
copy ("$f","$target_dir"); |
}elsif (-d "$n") {#copy folder |
dircopy ("$n","$target_dir/$name"); |
}elsif(-d "$f" ){ |
dircopy ("$f","$target_dir/$name"); |
|
} |
} |
|
} |
|
sub read_file_cntent { |
my ($f,$project_dir)=@_; |
my $n="$project_dir$f"; |
my $str; |
if (-f "$n") { #copy file |
|
$str = do { |
local $/ = undef; |
open my $fh, "<", $n |
or die "could not open $n: $!"; |
<$fh>; |
}; |
|
}elsif(-f "$f" ){ |
$str = do { |
local $/ = undef; |
open my $fh, "<", $f |
or die "could not open $f: $!"; |
<$fh>; |
}; |
|
|
} |
return $str |
|
} |
|
|
sub metric_conversion{ |
my $size=shift; |
my $size_text= $size==0 ? 'Error': |
$size<(1 << 10)? $size: |
$size<(1 << 20)? join (' ', ($size>>10,"K")) : |
$size<(1 << 30)? join (' ', ($size>>20,"M")) : |
join (' ', ($size>>30,"G")) ; |
return $size_text; |
} |
|
1 |
/perl/soc.pm
27,7 → 27,7
if(exists ($self->{instances}{$instance_id})){ |
return 0; |
} |
my $module_name=$ip->ip_get_module_name($category,$module); |
my $module_name=$ip->ip_get($category,$module,"module_name"); |
#print "$module_name\n"; |
$self->{instances}{$instance_id}={}; |
$self->{instances}{$instance_id}{module}=$module; |
/perl/ip_gen.pl
53,7 → 53,7
my ($file,$ipgen,$soc_state,$info)=@_; |
my ($name,$path,$suffix) = fileparse("$file",qr"\..[^.]*$"); |
if($suffix eq '.IP'){ |
$ipgen->ipgen_set_file($file); |
$ipgen->ipgen_add("file_name",$file); |
set_state($soc_state,"load_file",0); |
|
|
74,8 → 74,11
my $vdb = read_file($file); |
my @modules=sort $vdb->get_modules($file); |
#foreach my $p(@module_list) {print "$p\n"} |
$ipgen->ipgen_set_file($file); |
$ipgen->ipgen_set_module_name($modules[0]); |
$ipgen->ipgen_add("file_name",$file); |
|
|
|
$ipgen->ipgen_add("module_name",$modules[0]); |
$ipgen->ipgen_set_module_list(@modules); |
load_deafult_setting($ipgen,$modules[0]); |
|
237,9 → 240,9
my $browse= def_image_button("icons/browse.png","Browse"); |
my $label2= gen_label_in_left(" IP name:"); |
my $entry2= gen_entry(); |
my $file= $ipgen->ipgen_get_file(); |
my $file= $ipgen->ipgen_get("file_name"); |
if(defined $file){$entry->set_text($file);} |
my $ip_name= $ipgen->ipgen_get_ip_name(); |
my $ip_name= $ipgen->ipgen_get("ip_name"); |
if(defined $ip_name){$entry2->set_text($ip_name);} |
show_info(\$info,"Please select the verilog file containig the ip module\n"); |
$browse->signal_connect("clicked"=> sub{ |
290,7 → 293,7
}); |
$entry2->signal_connect("changed"=>sub{ |
my $name=$entry2->get_text(); |
$ipgen->ipgen_set_ip_name($name); |
$ipgen->ipgen_add("ip_name",$name); |
|
}); |
$table->attach_defaults ($label, 0, 1 , $row, $row+1); |
312,7 → 315,7
my ($ipgen,$soc_state,$info,$table,$row)=@_; |
my $label= gen_label_in_left(" Select\n module:"); |
my @modules= $ipgen->ipgen_get_module_list(); |
my $saved_module=$ipgen->ipgen_get_module_name(); |
my $saved_module=$ipgen->ipgen_get("module_name"); |
my $pos=(defined $saved_module ) ? get_scolar_pos( $saved_module,@modules) : 0; |
my $combo = gen_combo(\@modules, $pos); |
my $param= def_image_button("icons/setting.png","Parameter\n setting"); |
319,7 → 322,7
my $def= def_image_button("icons/setting.png","Definition\n file setting"); |
my $label2= gen_label_in_left(" Select\n Category:"); |
my ($category,$category_entry)=gen_entry_help('Define the IP category:e.g RAM, GPIO,...'); |
my $saved_category=$ipgen->ipgen_get_category(); |
my $saved_category=$ipgen->ipgen_get("category"); |
if(defined $saved_category){$category_entry->set_text($saved_category);} |
my $ipinfo= def_image_button("icons/info.png"," IP\n Description"); |
my $header_h= def_image_button("icons/h_file.png","Add Software\n files"); |
358,7 → 361,7
}); |
$category_entry->signal_connect("changed"=> sub{ |
my $name=$category_entry->get_text(); |
$ipgen->ipgen_set_category($name); |
$ipgen->ipgen_add("category",$name); |
|
}); |
$ipinfo->signal_connect("clicked"=> sub{ |
366,11 → 369,61
|
}); |
$header_h->signal_connect("clicked"=> sub{ |
get_software_file($ipgen,$soc_state,$info); |
my %page_info; |
my $help1="The files and folder that selected here will be copied in genertated processing tile SW folder."; |
my $help2="The file listed here can contain some variable with \${var_name} format. The file genertor will replace them with their values during file generation. The variable can be selected from above listed global vairable"; |
my $help3='Define the header file for this peripheral device. You can use global vriables listed at the top. |
|
header file example |
|
#define ${IP}_REG_0 (*((volatile unsigned int *) ($BASE))) |
#define ${IP}_REG_1 (*((volatile unsigned int *) ($BASE+4))) |
|
|
#define ${IP}_WRITE_REG1(value) ${IP}_REG_1=value |
#define ${IP}_READ_REG1() ${IP}_REG_1 |
'; |
|
$page_info{0}{page_name} = "_Add exsiting file/folder"; |
$page_info{0}{filed_name}= "sw_files"; |
$page_info{0}{filed_type}= "exsiting_file/folder"; |
$page_info{0}{rename_file}=undef; |
$page_info{0}{folder_en}=1; |
$page_info{0}{help}=$help1; |
|
$page_info{1}{page_name} = "_Add file generator(s)"; |
$page_info{1}{filed_name}= "gen_sw_files"; |
$page_info{1}{filed_type}= "file_generators"; |
$page_info{1}{rename_file}=1; |
$page_info{1}{folder_en}=0; |
$page_info{1}{help}=$help2; |
|
$page_info{2}{page_name} = "_Add to system.h"; |
$page_info{2}{filed_name}= "system_h"; |
$page_info{2}{filed_type}= "file_content"; |
$page_info{2}{rename_file}=undef; |
$page_info{2}{folder_en}=0; |
$page_info{2}{help}=$help3; |
|
|
get_source_file($ipgen,$soc_state,$info,0,"Add software file(s)","SW",\%page_info); |
#get_software_file($ipgen,$soc_state,$info,0); |
|
}); |
$lib_hdl->signal_connect("clicked"=> sub{ |
get_hdl_file($ipgen,$soc_state,$info); |
my $help1="The files and folder that selected here will be copied in genertated processing tile RTL folder."; |
my %page_info; |
$page_info{0}{page_name} = "_Add exsiting HDL file/folder"; |
$page_info{0}{filed_name}= "hdl_files"; |
$page_info{0}{filed_type}= "exsiting_file/folder"; |
$page_info{0}{rename_file}=undef; |
$page_info{0}{folder_en}=1; |
$page_info{0}{help}=$help1; |
|
get_source_file($ipgen,$soc_state,$info,0,"Add HDL file(s)", "hw",\%page_info); |
|
#get_hdl_file($ipgen,$soc_state,$info); |
|
|
}); |
} |
377,8 → 430,8
|
sub load_deafult_setting{ |
my ($ipgen,$module)=@_; |
my $file= $ipgen->ipgen_get_file(); |
$ipgen->ipgen_set_module_name($module); |
my $file= $ipgen->ipgen_get("file_name"); |
$ipgen->ipgen_add("module_name",$module); |
my $vdb =read_file($file); |
my %parameters = $vdb->get_modules_parameters_not_local($module); |
my @parameters_order= $vdb->get_modules_parameters_not_local_order($module); |
395,7 → 448,7
|
} |
#add parameter order. |
$ipgen->ipgen_add_parameters_order(@parameters_order); |
$ipgen->ipgen_add("parameters_order",\@parameters_order); |
#add port order. |
$ipgen->ipgen_add_ports_order(@ports_order); |
#add ports |
439,10 → 492,9
$scrolled_win->add_with_viewport($table); |
$table->show; |
$scrolled_win->show_all; |
|
|
#print "llllllllllllllllllllllllllllllllllllll\n"; |
|
|
}); |
|
return $scrolled_win; |
519,8 → 571,8
sub get_parameter_setting { |
my ($ipgen,$soc_state,$info)=@_; |
|
my $module = $ipgen->ipgen_get_module_name(); |
my $file= $ipgen->ipgen_get_file(); |
my $module = $ipgen->ipgen_get("module_name"); |
my $file= $ipgen->ipgen_get("file_name"); |
if (!defined $file) { |
message_dialog("The input verilog file is empty"); |
return; |
583,7 → 635,7
|
|
my @parameters=$ipgen->ipgen_get_all_parameters_list(); |
my @params_order= $ipgen->ipgen_get_parameters_order(); |
my @params_order= $ipgen->ipgen_get_list("parameters_order"); |
if((@params_order)) {@parameters=@params_order;} |
|
my $ok = def_image_button('icons/select.png','OK'); |
774,7 → 826,7
|
sub get_Description{ |
my ($ipgen,$soc_state,$info)=@_; |
my $description = $ipgen->ipgen_get_description(); |
my $description = $ipgen->ipgen_get("description"); |
my $table = Gtk2::Table->new (15, 15, TRUE); |
my $window=def_popwin_size(500,500,"Add description"); |
my ($scrwin,$text_view)=create_text(); |
790,7 → 842,7
$window->destroy; |
|
my $text = $text_buffer->get_text($text_buffer->get_bounds, TRUE); |
$ipgen->ipgen_set_description($text); |
$ipgen->ipgen_add("description",$text); |
#print "$text\n"; |
|
}); |
801,204 → 853,85
} |
|
|
########### |
# get header file |
######### |
|
sub get_header_file{ |
my ($ipgen,$soc_state,$info)=@_; |
my $hdr = $ipgen->ipgen_get_hdr(); |
my $table = Gtk2::Table->new (15, 15, TRUE); |
#my $window=def_popwin_size(600,600,"Add header file"); |
my ($scrwin,$text_view)=create_text(); |
|
my $help_text= |
'Define the header file for this peripheral device. |
You can use two variable $BASEn and $IP. |
$BASE is the wishbone base addresse(s) and will be added |
during soc generation to system.h. If more than one slave |
wishbone bus are used define them as $BASE0, $BASE1 ... |
|
$IP: is the peripheral device name. When more than one |
peripheral device is allowed to be called in the SoC, it is |
recommended to add $IP to the global variables, definitions |
and functions. |
|
header file example |
|
#define $IP_REG_0 (*((volatile unsigned int *) ($BASE))) |
#define $IP_REG_1 (*((volatile unsigned int *) ($BASE+4))) |
|
|
#define $IP_WRITE_REG1(value) $IP_REG_1=value |
#define $IP_READ_REG1() $IP_REG_1 |
'; |
|
my $help=gen_label_help($help_text,"Define the header file for this peripheral device. "); |
$table->attach_defaults($help,0,15,0,1); |
$table->attach_defaults($scrwin,0,15,1,14); |
my $text_buffer = $text_view->get_buffer; |
if(defined $hdr) {$text_buffer->set_text($hdr)}; |
|
|
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef); |
$scrolled_win->set_policy( "automatic", "automatic" ); |
$scrolled_win->add_with_viewport($table); |
|
#$window->add($table); |
#$window->show_all(); |
return ($scrolled_win,$text_buffer); |
|
} |
|
############# |
# get hdl files |
############ |
sub get_hdl_file{ |
my ($ipgen,$soc_state,$info)=@_; |
my $table = Gtk2::Table->new (15, 15, TRUE); |
my $window=def_popwin_size(600,600,"Add HDL file()s"); |
my @saved_files=$ipgen->ipgen_get_files_list("hdl_files"); |
my $ok=def_image_button("icons/select.png",' Ok '); |
my $scrwin=gen_file_list($ipgen,"hdl_files",\@saved_files,$ok); |
|
my $label=gen_label_in_left("Selecet the design files you want to include for the IP core"); |
my $brows=def_image_button("icons/browse.png",' Browse'); |
$table->attach_defaults($label,0,10,0,1); |
$table->attach_defaults($brows,10,12,0,1); |
$table->attach_defaults($scrwin,0,15,1,14); |
$table->attach_defaults($ok,6,9,14,15); |
|
my $dir = Cwd::getcwd(); |
my $project_dir = abs_path("$dir/../../"); #mpsoc directory address |
|
|
$brows->signal_connect("clicked"=> sub { |
my @files; |
my $dialog = Gtk2::FileChooserDialog->new( |
'Select a File', |
undef, |
'open', |
'gtk-cancel' => 'cancel', |
'gtk-ok' => 'ok', |
); |
|
my $filter = Gtk2::FileFilter->new(); |
my $dir = Cwd::getcwd(); |
$dialog->set_current_folder ("$dir/..") ; |
$dialog->set_select_multiple(TRUE); |
|
if ( "ok" eq $dialog->run ) { |
@files = $dialog->get_filenames; |
|
@saved_files=$ipgen->ipgen_get_files_list("hdl_files"); |
foreach my $p (@files){ |
#remove $project_dir form beginig of each file |
$p =~ s/$project_dir//; |
if(! grep (/^$p$/,@saved_files)){push(@saved_files,$p)}; |
|
} |
$ipgen->ipgen_set_files_list("hdl_files",\@saved_files); |
$window->destroy; |
get_hdl_file($ipgen,$soc_state,$info); |
|
#$$entry_ref->set_text($file); |
|
#print "file = $file\n"; |
} |
$dialog->destroy; |
|
|
|
} );# # ,\$entry); |
|
|
|
|
|
$ok->signal_connect("clicked"=> sub { |
|
|
|
$window->destroy; |
|
#my $text = $text_buffer->get_text($text_buffer->get_bounds, TRUE); |
#$ipgen->ipgen_set_hdr($text); |
#print "$text\n"; |
|
}); |
|
$window->add($table); |
$window->show_all(); |
|
} |
|
|
|
|
########## |
# |
# gen_file_list |
######### |
|
sub gen_file_list{ |
my ($ipgen,$list_name,$ref,$ok)=@_; |
my @files=@{$ref}; |
my $file_num= scalar @files; |
my ($ipgen,$list_name,$window,$rename_file_en)=@_; |
|
|
my $table=def_table(10,10,TRUE);# my ($row,$col,$homogeneous)=@_; |
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef); |
my $ok=def_image_button("icons/select.png",' Ok '); |
|
$scrolled_win->set_policy( "automatic", "automatic" ); |
$scrolled_win->add_with_viewport($table); |
|
|
$table->attach_defaults (gen_label_in_center("File path"), 0, 5 , 0, 1); |
$table->attach_defaults (gen_label_help("The target name can contain any of Global variables e.g \$IP\$.h","Copy as"), 5, 9 , 0, 1) if(defined $rename_file_en); |
my $col=0; |
my $row=0; |
my $row=1; |
my @files= $ipgen->ipgen_get_list($list_name); #@{$ref}; |
my $file_num= scalar @files; |
foreach my $p(@files){ |
my $entry=gen_entry($p); |
my $remove=def_image_button("icons/cancel.png"); |
$table->attach_defaults ($entry, 0, 9 , $row, $row+1); |
$table->attach_defaults ($remove, 9,10 , $row, $row+1); |
$row++; |
$remove->signal_connect("clicked"=> sub { |
my @saved_files=$ipgen->ipgen_get_files_list($list_name); |
@saved_files=remove_scolar_from_array(\@saved_files,$p); |
$ipgen->ipgen_set_files_list($list_name,\@saved_files); |
$entry->destroy; |
$remove->destroy; |
my ($path,$rename)=split('frename_sep_t',$p); |
my $entry=gen_entry($path); |
my $entry2=gen_entry($rename) ; |
my $remove=def_image_button("icons/cancel.png"); |
$table->attach_defaults ($entry, 0, 5 , $row, $row+1); |
$table->attach_defaults ($entry2, 5, 9 , $row, $row+1) if(defined $rename_file_en); |
$table->attach_defaults ($remove, 9,10 , $row, $row+1); |
$row++; |
$remove->signal_connect("clicked"=> sub { |
my @saved_files=$ipgen->ipgen_get_list($list_name); |
@saved_files=remove_scolar_from_array(\@saved_files,$p); |
$ipgen->ipgen_add($list_name,\@saved_files); |
$entry->destroy; |
$entry2->destroy if(defined $rename_file_en); |
$remove->destroy; |
|
}); |
$ok->signal_connect("clicked"=> sub { |
if(defined $entry){ |
my $n= $entry->get_text(); |
if($p ne $n){ |
my @saved_files=$ipgen->ipgen_get_files_list($list_name); |
@saved_files=replace_in_array(\@saved_files,$p, $n); |
$ipgen->ipgen_set_files_list($list_name,\@saved_files); |
}); |
$ok->signal_connect("clicked"=> sub { |
if(defined $entry){ |
my $n= $entry->get_text(); |
if(defined $rename_file_en){ |
$n= $n.'frename_sep_t'.$entry2->get_text() ; |
} |
if($p ne $n){ |
my @saved_files=$ipgen->ipgen_get_list($list_name); |
@saved_files=replace_in_array(\@saved_files,$p, $n); |
$ipgen->ipgen_add($list_name,\@saved_files); |
} |
|
} |
|
} |
|
|
|
}); |
}); |
|
#my $seph = Gtk2::HSeparator->new; |
#$table->attach_defaults ($seph, 0, 10 , $row, $row+1); |
#$row++; |
#my $seph = Gtk2::HSeparator->new; |
#$table->attach_defaults ($seph, 0, 10 , $row, $row+1); |
#$row++; |
|
} |
|
|
|
|
$ok->signal_connect("clicked"=> sub { |
$window->destroy; |
}); |
|
# while( $row<10){ |
# my $label=gen_label_in_left(' '); |
# $table->attach_defaults ($label, 0, 1 , $row, $row+1);$row++; |
#} |
|
|
return $scrolled_win; |
|
return ($scrolled_win,$ok); |
} |
|
|
1079,7 → 1012,7
my $advance_button=def_image_button('icons/advance.png','separate'); |
$table->attach_defaults ($type_box, $positions[2], $positions[3], $row, $row+1); |
$table->attach_defaults ($advance_button, $positions[3], $positions[4], $row, $row+1); |
$type_spin->signal_connect("changed"=>sub{ |
$type_spin->signal_connect("value_changed"=>sub{ |
my $wiget=shift; |
my $num=$wiget->get_value_as_int(); |
$ipgen->ipgen_add_soket($p,'num',$num); |
1163,7 → 1096,7
$type_box->pack_start($name_setting,FALSE,FALSE,0); |
$type_spin->set_value($value); |
$table->attach_defaults ($type_box, $positions[2], $positions[3], $row, $row+1); |
$type_spin->signal_connect("changed"=>sub{ |
$type_spin->signal_connect("value_changed"=>sub{ |
my $wiget=shift; |
my $num=$wiget->get_value_as_int(); |
$ipgen->ipgen_add_plug($q,'num',$num); |
1207,8 → 1140,10
return $table; |
|
} |
######## |
# get_intfc_setting |
######## |
|
|
sub get_intfc_setting{ |
|
my ($ipgen,$soc_state,$intfc_name, $intfc_type)=@_; |
1299,6 → 1234,7
my $name_combo=gen_combo(\@list,$pos); |
my $sbox=def_hbox(FALSE,0); |
my $widget; |
my $size_lab; |
my @l=("Fixed","Parameterizable"); |
|
if(!defined $saved_width){ |
1311,6 → 1247,8
$pos= 0; |
$widget=gen_spin(1,31,1); |
$widget->set_value($saved_width); |
my $d=2**$saved_width; |
$size_lab=gen_label_in_left(metric_conversion($d). " Bytes"); |
} else{ |
$pos= 1; |
my @parameters=$ipgen->ipgen_get_all_parameters_list(); |
1317,6 → 1255,7
my $p=get_scolar_pos($saved_width,@parameters); |
|
$widget=gen_combo(\@parameters, $p); |
$size_lab=gen_label_in_left(" "); |
|
} |
|
1329,16 → 1268,38
#$widget->set_value($saved_width); |
$sbox->pack_start($comb,FALSE,FALSE,3); |
$sbox->pack_end($widget,FALSE,FALSE,3); |
|
$sbox->pack_end($size_lab,FALSE,FALSE,3); |
$comb->signal_connect('changed'=>sub{ |
my $condition=$comb->get_active_text(); |
$widget->destroy; |
$size_lab->destroy; |
my @parameters=$ipgen->ipgen_get_all_parameters_list(); |
$widget=($condition eq "Fixed" )? gen_spin(1,31,1):gen_combo(\@parameters, 0); |
$size_lab=($condition eq "Fixed" )? gen_label_in_left("2 Bytes"): gen_label_in_left(" "); |
$sbox->pack_end($widget,FALSE,FALSE,3); |
$sbox->pack_end($size_lab,FALSE,FALSE,3); |
$sbox->show_all(); |
$widget->signal_connect('changed'=>sub{ |
$size_lab->destroy; |
my $in=$comb->get_active_text(); |
my $width=($in eq "Fixed" )? $widget->get_value_as_int(): $widget->get_active_text() ; |
my $d=($in eq "Fixed" )? 2**$width:0; |
|
$size_lab=($in eq "Fixed" )? gen_label_in_left( metric_conversion($d). " Bytes"):gen_label_in_left(" "); |
$sbox->pack_end($size_lab,FALSE,FALSE,3); |
$sbox->show_all(); |
}); |
}); |
|
$widget->signal_connect('changed'=>sub{ |
$size_lab->destroy; |
my $in=$comb->get_active_text(); |
my $width=($in eq "Fixed" )? $widget->get_value_as_int(): $widget->get_active_text() ; |
my $d=($in eq "Fixed" )? 2**$width:0; |
|
$size_lab=($in eq "Fixed" )? gen_label_in_left(metric_conversion($d). " Bytes"):gen_label_in_left(" "); |
$sbox->pack_end($size_lab,FALSE,FALSE,3); |
$sbox->show_all(); |
}); |
|
$table->attach_defaults($name_combo,2,5,$i+1,$i+2); |
$table->attach_defaults($sbox,5,6,$i+1,$i+2); |
1586,14 → 1547,14
|
sub generate_ip{ |
my $ipgen=shift; |
my $name=$ipgen->ipgen_get_module_name(); |
my $category=$ipgen->ipgen_get_category(); |
my $ip_name= $ipgen->ipgen_get_ip_name(); |
my $name=$ipgen->ipgen_get("module_name"); |
my $category=$ipgen->ipgen_get("category"); |
my $ip_name= $ipgen->ipgen_get("ip_name"); |
#check if name has been set |
if(defined ($name) && defined ($category)){ |
if (!defined $ip_name) {$ip_name= $name} |
#check if any source file has been added for this ip |
my @l=$ipgen->ipgen_get_files_list("hdl_files"); |
my @l=$ipgen->ipgen_get_list("hdl_files"); |
if( scalar @l ==0){ |
my $mwindow; |
my $dialog = Gtk2::MessageDialog->new ($mwindow, |
1668,7 → 1629,7
$file = $dialog->get_filename; |
my ($name,$path,$suffix) = fileparse("$file",qr"\..[^.]*$"); |
if($suffix eq '.IP'){ |
$ipgen->ipgen_set_file($file); |
$ipgen->ipgen_add("file_name",$file); |
set_state($soc_state,"load_file",0); |
} |
} |
1680,31 → 1641,83
|
|
|
|
|
|
############ |
# get_source_file |
########### |
# get header file |
######### |
|
sub get_sw_file_folder{ |
my ($ipgen,$soc_state,$info,$window)=@_; |
my @sw_dir = $ipgen->ipgen_get_files_list("sw_files"); |
my $table = Gtk2::Table->new (15, 15, TRUE); |
|
|
sub get_source_file{ |
my($ipgen,$soc_state,$info,$page,$title,$dest,$page_info_ref)=@_; |
|
|
my $var_list='${parameter_name}: Verilog module parameter values. |
|
${BASE}: is the wishbone base addresse(s) and will be added during soc generation to system.h. If more than one slave wishbone bus are used define them as ${BASE0}, ${BASE1}... . |
|
${IP}: is the peripheral device instance name. |
|
${CORE}: is the peripheral device module name.'; |
my $var_help=gen_button_message($var_list,"icons/info.png","Global variables"); |
|
my($width,$hight)=max_win_size(); |
my $window = def_popwin_size($width*2/3,$hight*2/3,$title); |
|
my $help=gen_label_help("The files and folder that selected here will be copied in genertated processing tile SW folder."); |
my $notebook=source_notebook($ipgen,$soc_state,$info,$window,$page,$dest,$page_info_ref); |
my $table=def_table (15, 15, TRUE); |
|
|
$table->attach_defaults ($var_help, 5, 7, 0, 1); |
$table->attach_defaults ($notebook , 0, 15, 1, 15); |
|
$window->add($table); |
$window->show_all; |
return $window; |
|
$table->attach_defaults($help,0,15,0,1); |
my $ok=def_image_button("icons/select.png",' Ok '); |
my $scrwin=gen_file_list($ipgen,"sw_files",\@sw_dir,$ok); |
} |
|
########## |
# source_notebook |
########## |
|
sub source_notebook{ |
my($ipgen,$soc_state,$info,$window,$page,$dest,$page_info_ref)=@_; |
my $notebook = Gtk2::Notebook->new; |
my %page_info=%{$page_info_ref}; |
foreach my $p (sort keys %page_info){ |
my $page_ref; |
$page_ref=get_file_folder($ipgen,$soc_state,$info,$window,$p,$page_info_ref) if($page_info{$p}{filed_type} eq "exsiting_file/folder"); |
$page_ref=get_file_folder($ipgen,$soc_state,$info,$window,$p,$page_info_ref) if($page_info{$p}{filed_type} eq "file_generators"); |
$page_ref=get_file_content($ipgen,$soc_state,$info,$window,$page_info{$p},$page_info_ref) if($page_info{$p}{filed_type} eq "file_content"); |
$notebook->append_page ($page_ref,Gtk2::Label->new_with_mnemonic ($page_info{$p}{page_name})); |
|
} |
$notebook->show_all; |
$notebook->set_current_page($page) if(defined $page); |
return $notebook; |
|
} |
|
########## |
# get_file_folder |
######### |
|
sub get_file_folder{ |
my ($ipgen,$soc_state,$info,$window,$page,$page_info_ref)=@_; |
my %page_info=%{$page_info_ref}; |
my @sw_dir = $ipgen->ipgen_get_list($page_info{$page}{filed_name}); |
my $table = Gtk2::Table->new (15, 15, TRUE); |
my $help=gen_label_help($page_info{$page}{help}); |
$table->attach_defaults($help,0,2,0,1); |
my ($scrwin,$ok)=gen_file_list($ipgen,$page_info{$page}{filed_name},$window,$page_info{$page}{rename_file}); |
|
my $label=gen_label_in_left("Selecet file(s):"); |
my $brows=def_image_button("icons/browse.png",' Browse'); |
$table->attach_defaults($label,1,3,1,2); |
$table->attach_defaults($brows,3,5,1,2); |
my $label2=gen_label_in_left("Selecet folder(s):"); |
my $brows2=def_image_button("icons/browse.png",' Browse'); |
$table->attach_defaults($label2,7,9,1,2); |
$table->attach_defaults($brows2,9,11,1,2); |
$table->attach_defaults($label,2,4,0,1); |
$table->attach_defaults($brows,4,6,0,1); |
|
my $dir = Cwd::getcwd(); |
my $project_dir = abs_path("$dir/../../"); #mpsoc directory address |
1726,170 → 1739,132
$dialog->set_select_multiple(TRUE); |
|
if ( "ok" eq $dialog->run ) { |
@files = $dialog->get_filenames; |
|
@sw_dir=$ipgen->ipgen_get_files_list("sw_files"); |
@files = $dialog->get_filenames; |
@sw_dir=$ipgen->ipgen_get_list($page_info{$page}{filed_name}); |
foreach my $p (@files){ |
#remove $project_dir form beginig of each file |
$p =~ s/$project_dir//; |
$p =~ s/$project_dir//; |
my ($name,$path,$suffix) = fileparse("$p",qr"\..[^.]*$"); |
$p=$p.'frename_sep_t'.$name.$suffix if (defined $page_info{$page}{rename_file}); |
if(! grep (/^$p$/,@sw_dir)){push(@sw_dir,$p)}; |
|
} |
|
$ipgen->ipgen_set_files_list("sw_files",\@sw_dir); |
get_software_file($ipgen,$soc_state,$info); |
} |
$ipgen->ipgen_add($page_info{$page}{filed_name},\@sw_dir); |
get_source_file($ipgen,$soc_state,$info,$page,"Add software file(s)","SW",$page_info_ref); |
$window->destroy; |
|
|
#$$entry_ref->set_text($file); |
|
#print "file = $file\n"; |
} |
$dialog->destroy; |
|
|
|
} );# # ,\$entry); |
|
|
|
|
$brows2->signal_connect("clicked"=> sub { |
my @files; |
if($page_info{$page}{folder_en} eq 1){ |
my $label2=gen_label_in_left("Selecet folder(s):"); |
my $brows2=def_image_button("icons/browse.png",' Browse'); |
$table->attach_defaults($label2,7,9,0,1); |
$table->attach_defaults($brows2,9,11,0,1); |
|
$brows2->signal_connect("clicked"=> sub { |
my @files; |
|
my $dialog = Gtk2::FileChooserDialog->new( |
'Select Folder(s)', |
undef, |
'select-folder', |
'gtk-cancel' => 'cancel', |
'gtk-ok' => 'ok', |
); |
|
|
|
|
my $filter = Gtk2::FileFilter->new(); |
my $dir = Cwd::getcwd(); |
$dialog->set_current_folder ("$dir/..") ; |
$dialog->set_select_multiple(TRUE); |
my $dialog = Gtk2::FileChooserDialog->new( |
'Select Folder(s)', |
undef, |
'select-folder', |
'gtk-cancel' => 'cancel', |
'gtk-ok' => 'ok', |
); |
|
my $filter = Gtk2::FileFilter->new(); |
my $dir = Cwd::getcwd(); |
$dialog->set_current_folder ("$dir/..") ; |
$dialog->set_select_multiple(TRUE); |
|
if ( "ok" eq $dialog->run ) { |
@files = $dialog->get_filenames; |
|
@sw_dir=$ipgen->ipgen_get_files_list("sw_files"); |
foreach my $p (@files){ |
#remove $project_dir form beginig of each file |
$p =~ s/$project_dir//; |
if(! grep (/^$p$/,@sw_dir)){push(@sw_dir,$p)}; |
|
} |
|
$ipgen->ipgen_set_files_list("sw_files",\@sw_dir); |
get_software_file($ipgen,$soc_state,$info); |
$window->destroy; |
|
|
#$$entry_ref->set_text($file); |
if ( "ok" eq $dialog->run ) { |
@files = $dialog->get_filenames; |
|
@sw_dir=$ipgen->ipgen_get_list($page_info{$page}{filed_name}); |
foreach my $p (@files){ |
#remove $project_dir form beginig of each file |
$p =~ s/$project_dir//; |
if(! grep (/^$p$/,@sw_dir)){push(@sw_dir,$p)}; |
|
} |
|
$ipgen->ipgen_add($page_info{$page}{filed_name},\@sw_dir); |
get_source_file($ipgen,$soc_state,$info,$page,"Add software file(s)","SW",$page_info_ref); |
$window->destroy; |
|
|
#$$entry_ref->set_text($file); |
|
#print "file = $file\n"; |
} |
$dialog->destroy; |
|
#print "file = $file\n"; |
} |
$dialog->destroy; |
|
|
|
} );# # ,\$entry); |
} );# # ,\$entry); |
} |
|
|
|
$table->attach_defaults($scrwin,0,15,1,14); |
$table->attach_defaults($ok,6,9,14,15); |
|
return ($table) |
|
|
$table->attach_defaults($scrwin,0,15,2,15); |
#$table->attach_defaults($ok,6,9,14,15); |
|
|
|
|
|
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef); |
$scrolled_win->set_policy( "automatic", "automatic" ); |
$scrolled_win->add_with_viewport($table); |
|
#$window->add($table); |
#$window->show_all(); |
return ($scrolled_win); |
|
} |
|
|
|
########### |
# get_file_content |
######### |
|
sub get_file_content{ |
my ($ipgen,$soc_state,$info,$window,$page_info_ref)=@_; |
my %page_info=%{$page_info_ref}; |
#my $hdr = $ipgen->ipgen_get_hdr(); |
my $hdr = $ipgen-> ipgen_get($page_info{filed_name}); |
my $table = Gtk2::Table->new (14, 15, TRUE); |
#my $window=def_popwin_size(600,600,"Add header file"); |
my ($scrwin,$text_view)=create_text(); |
|
sub get_software_file{ |
my($ipgen,$soc_state,$info)=@_; |
my $help=gen_label_help($page_info{help}); |
$table->attach_defaults($help,0,8,0,1); |
$table->attach_defaults($scrwin,0,15,1,14); |
my $text_buffer = $text_view->get_buffer; |
if(defined $hdr) {$text_buffer->set_text($hdr)}; |
|
my $ok=def_image_button("icons/select.png",' Save '); |
$ok->signal_connect("clicked"=> sub {# |
my $text = $text_buffer->get_text($text_buffer->get_bounds, TRUE); |
$ipgen->ipgen_add($page_info{filed_name},$text); |
$window->destroy; |
|
}); |
|
$table->attach_defaults($ok,6,9,14,15); |
return ($table); |
|
} |
|
my $notebook = Gtk2::Notebook->new; |
#$hbox->pack_start ($notebook, TRUE, TRUE, 0); |
|
my($width,$hight)=max_win_size(); |
my $window = def_popwin_size($width*2/3,$hight*2/3,"Add Software file(s)"); |
|
|
my ($sw_dir)=get_sw_file_folder($ipgen,$soc_state,$info,$window); |
$notebook->append_page ($sw_dir,Gtk2::Label->new_with_mnemonic ("_Add file/folder")); |
|
my ($hdr_file,$text_buffer)= get_header_file($ipgen,$soc_state,$info); |
$notebook->append_page ($hdr_file,Gtk2::Label->new_with_mnemonic ("_Add hedaer file")); |
|
|
|
#my $socgen=socgen_main(); |
#$notebook->append_page ($socgen,Gtk2::Label->new_with_mnemonic ("_Processing tile generator")); |
|
#my $mpsocgen =mpsocgen_main(); |
#$notebook->append_page ($mpsocgen,Gtk2::Label->new_with_mnemonic ("_NoC based MPSoC generator")); |
|
|
my $table=def_table (15, 15, TRUE); |
|
|
my $scrolled_win = new Gtk2::ScrolledWindow (undef, undef); |
$scrolled_win->set_policy( "automatic", "automatic" ); |
$scrolled_win->add_with_viewport($table); |
|
|
|
|
|
|
|
|
my $ok=def_image_button("icons/select.png",' Ok '); |
$ok->signal_connect("clicked"=> sub { |
$window->destroy; |
|
my $text = $text_buffer->get_text($text_buffer->get_bounds, TRUE); |
$ipgen->ipgen_set_hdr($text); |
#print "$text\n"; |
|
}); |
|
#$table->attach_defaults ($event_box, $col, $col+1, $row, $row+1); |
$table->attach_defaults ($ok , 7, 9, 14, 15); |
|
$table->attach_defaults ($notebook , 0, 15, 0, 14); |
# |
$window->add($scrolled_win); |
$window->show_all; |
return $window; |
|
|
|
|
} |
|
|
|
|
|
############ |
# get_unused_intfc_ports_list |
########### |
1900,7 → 1875,7
my ($name_ref,$ref)=get_list_of_all_interfaces($ipgen); |
my @interfaces_name=@{$name_ref}; |
my @interfaces=@{$ref}; |
$ipgen->ipgen_remove_unused_intfc_port( ); |
$ipgen->ipgen_remove("unused"); |
foreach my $intfc_name (@interfaces) |
{ |
#print "$intfc_name\n"; |
1946,6 → 1921,21
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
############ |
# main |
############ |
2003,7 → 1993,7
|
my ($state,$timeout)= get_state($soc_state); |
if($state eq "load_file"){ |
my $file=$ipgen->ipgen_get_file(); |
my $file=$ipgen->ipgen_get("file_name"); |
my $pp= eval { do $file }; |
clone_obj($ipgen,$pp); |
|
/perl/ip_gen.pm
34,39 → 34,8
return $self; |
} |
|
sub ipgen_set_file{ |
my ($self,$file)=@_; |
$self->{file_name}=$file; |
} |
|
|
|
sub ipgen_get_file{ |
my $self=shift; |
return $self->{file_name}; |
} |
|
sub ipgen_set_module_name{ |
my ($self,$module)=@_; |
$self->{module_name}=$module; |
} |
|
sub ipgen_get_module_name{ |
my ($self)=@_; |
return $self->{module_name}; |
} |
|
sub ipgen_set_ip_name{ |
my ($self,$name)=@_; |
$self->{ip_name}=$name; |
} |
|
sub ipgen_get_ip_name{ |
my ($self)=@_; |
return $self->{ip_name}; |
} |
|
|
sub ipgen_set_module_list{ |
my ($self,@list)=@_; |
$self->{modules}={}; |
101,20 → 70,8
|
|
|
sub ipgen_add_parameters_order{ |
my ($self,@parameters_order)=@_; |
$self->{parameters_order}=\@parameters_order; |
|
|
} |
|
|
sub ipgen_get_parameters_order{ |
my $self=shift; |
my @r; |
@r = @{$self->{parameters_order}} if (defined $self->{parameters_order}); |
return @r; |
} |
|
sub ipgen_push_parameters_order{ |
my ($self,$param)=@_; |
378,44 → 335,11
} |
|
|
sub ipgen_set_category{ |
my ($self,$category)=@_; |
if(defined $category){ |
$self->{category}=$category; |
|
} |
|
} |
|
|
|
sub ipgen_get_category{ |
my ($self)=@_; |
my $category; |
if(exists ($self->{category})){ |
$category=$self->{category}; |
} |
return $category; |
} |
|
|
sub ipgen_get_description{ |
my ($self)=@_; |
my $description; |
if(exists ($self->{description})){ |
$description=$self->{description}; |
} |
return $description; |
} |
|
sub ipgen_set_description{ |
my ($self,$description)=@_; |
$self->{description}=$description; |
|
|
} |
|
|
sub ipgen_save_wb_addr{ |
my ($self,$plug,$num,$addr,$width)=@_; |
$self->{plugs}{$plug}{$num}{addr}=$addr; |
473,27 → 397,35
|
} |
|
sub ipgen_set_hdr{ |
my ($self,$hdr)=@_; |
$self->{header}=$hdr; |
} |
|
|
sub ipgen_add_unused_intfc_port{ |
my ($self,$intfc_name,$port)=@_; |
push(@{$self->{unused}{$intfc_name}},$port); |
} |
|
sub ipgen_get_hdr{ |
my ($self)=@_; |
my $hdr; |
if(exists ($self->{header})){ |
$hdr=$self->{header}; |
|
} |
return $hdr; |
|
|
|
|
#add,read,remove object fileds |
|
sub ipgen_add{ |
my ($self,$filed_name,$filed_data)=@_; |
$self->{$filed_name}=$filed_data; |
} |
|
sub ipgen_remove{ |
my ($self,$filed_name)=@_; |
$self->{$filed_name}=undef; |
} |
|
sub ipgen_get{ |
my ($self,$filed_name)=@_; |
return $self->{$filed_name} |
} |
|
|
sub ipgen_get_files_list{ |
sub ipgen_get_list{ |
my ($self,$list_name)=@_; |
my @l; |
if ( defined $self->{$list_name} ){ |
504,28 → 436,8
} |
|
|
sub ipgen_set_files_list{ |
my ($self,$list_name,$ref)=@_; |
$self->{$list_name}= $ref; |
} |
|
|
sub ipgen_add_unused_intfc_port{ |
my ($self,$intfc_name,$port)=@_; |
push(@{$self->{unused}{$intfc_name}},$port); |
} |
|
sub ipgen_get_unused_intfc_ports{ |
my $self=shift; |
return $self->{unused}; |
|
} |
|
sub ipgen_remove_unused_intfc_port{ |
my $self=shift; |
$self->{unused}=undef; |
} |
|
###################################### |
|
|
/ip/altera_jtag_uart.IP
3,120 → 3,120
'/mpsoc/src_peripheral/jtag/altera_jtag_uart_wb.v' |
], |
'ip_name' => 'altera_jtag_uart', |
'modules' => { |
'qsys_jtag_uart_0_scfifo_w' => {}, |
'qsys_jtag_uart_0_scfifo_r' => {}, |
'qsys_jtag_uart_0_sim_scfifo_r' => {}, |
'qsys_jtag_uart_0' => {}, |
'altera_jtag_uart_wb' => {}, |
'qsys_jtag_uart_0_sim_scfifo_w' => {} |
}, |
'plugs' => { |
'clk' => { |
'clk' => {}, |
'value' => 1, |
'0' => { |
'name' => 'clk' |
}, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'value' => 1, |
'0' => { |
'name' => 'reset' |
}, |
'type' => 'num' |
}, |
'interrupt_peripheral' => { |
'interrupt_peripheral' => {}, |
'value' => 1, |
'0' => { |
'name' => 'interrupt_peripheral' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'0' => { |
'name' => 'reset' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'clk' => { |
'clk' => {}, |
'0' => { |
'name' => 'clk' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'wb_slave' => { |
'value' => 1, |
'0' => { |
'width' => 5, |
'name' => 'wb_slave', |
'addr' => '0x9000_0000 0x90ff_ffff UART16550 Controller' |
}, |
'value' => 1, |
'type' => 'num', |
'wb_slave' => {} |
} |
}, |
'modules' => { |
'qsys_jtag_uart_0_scfifo_w' => {}, |
'qsys_jtag_uart_0_scfifo_r' => {}, |
'altera_jtag_uart_wb' => {}, |
'qsys_jtag_uart_0' => {}, |
'qsys_jtag_uart_0_sim_scfifo_r' => {}, |
'qsys_jtag_uart_0_sim_scfifo_w' => {} |
}, |
'ports' => { |
'wb_irq' => { |
'intfc_name' => 'plug:interrupt_peripheral[0]', |
'intfc_port' => 'int_o', |
'intfc_name' => 'plug:interrupt_peripheral[0]', |
'range' => '', |
'type' => 'output' |
}, |
'stb_i' => { |
'intfc_port' => 'stb_i', |
'cyc_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'cyc_i', |
'range' => '', |
'type' => 'input' |
}, |
'cyc_i' => { |
'intfc_port' => 'cyc_i', |
'stb_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'stb_i', |
'range' => '', |
'type' => 'input' |
}, |
'dat_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'dat_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => ' 31: 0', |
'type' => 'input' |
}, |
'ack_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'ack_o', |
'range' => '', |
'type' => 'output' |
}, |
'rst' => { |
'intfc_name' => 'plug:reset[0]', |
'intfc_port' => 'reset_i', |
'intfc_name' => 'plug:reset[0]', |
'range' => '', |
'type' => 'input' |
}, |
'ack_o' => { |
'intfc_port' => 'ack_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'output' |
}, |
'readyfordata' => { |
'intfc_name' => 'IO', |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'output' |
}, |
'dat_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'dat_o', |
'range' => ' 31: 0', |
'type' => 'output' |
}, |
'adr_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'adr_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'input' |
}, |
'dat_o' => { |
'intfc_port' => 'dat_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => ' 31: 0', |
'type' => 'output' |
}, |
'clk' => { |
'intfc_name' => 'plug:clk[0]', |
'intfc_port' => 'clk_i', |
'intfc_name' => 'plug:clk[0]', |
'range' => '', |
'type' => 'input' |
}, |
'we_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'we_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'input' |
}, |
'dataavailable' => { |
'intfc_name' => 'IO', |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'output' |
} |
134,11 → 134,11
] |
}, |
'category' => 'Jtag', |
'header' => ' #define $IP_DATA_REG (*((volatile unsigned int *) ($BASE))) |
#define $IP_CONTROL_REG (*((volatile unsigned int *) ($BASE+4))) |
#define $IP_CONTROL_WSPACE_MSK 0xFFFF0000 |
#define $IP_DATA_RVALID_MSK 0x00008000 |
#define $IP_DATA_DATA_MSK 0x000000FF |
'system_h' => '#define ${IP}_DATA_REG (*((volatile unsigned int *) ($BASE))) |
#define ${IP}_CONTROL_REG (*((volatile unsigned int *) ($BASE+4))) |
#define ${IP}_CONTROL_WSPACE_MSK 0xFFFF0000 |
#define ${IP}_DATA_RVALID_MSK 0x00008000 |
#define ${IP}_DATA_DATA_MSK 0x000000FF |
|
//////////////////////////////*basic function for jtag_uart*//////////////////////////////////////// |
void jtag_putchar(char ch); |
147,16 → 147,16
char inbyte(){return jtag_getchar();} |
|
void jtag_putchar(char ch){ //print one char from jtag_uart |
while(($IP_CONTROL_REG&$IP_CONTROL_WSPACE_MSK)==0); |
$IP_DATA_REG=ch; |
while((${IP}_CONTROL_REG&${IP}_CONTROL_WSPACE_MSK)==0); |
${IP}_DATA_REG=ch; |
} |
|
char jtag_getchar(void){ //get one char from jtag_uart |
unsigned int data; |
data=$IP_DATA_REG; |
while(!(data & $IP_DATA_RVALID_MSK)) //wait for terminal input |
data=$IP_DATA_REG; |
return (data&$IP_DATA_DATA_MSK); |
data=${IP}_DATA_REG; |
while(!(data & ${IP}_DATA_RVALID_MSK)) //wait for terminal input |
data=${IP}_DATA_REG; |
return (data&${IP}_DATA_DATA_MSK); |
} |
|
int jtag_scanstr(char* buf){ //scan string until <ENTER> to buf, return str length |
/ip/ext_int.IP
3,6 → 3,45
'/mpsoc/src_peripheral/ext_int/ext_int.v' |
], |
'ip_name' => 'ext_int', |
'plugs' => { |
'interrupt_peripheral' => { |
'interrupt_peripheral' => {}, |
'value' => 1, |
'0' => { |
'name' => 'interrupt' |
}, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'value' => 1, |
'0' => { |
'name' => 'reset' |
}, |
'type' => 'num' |
}, |
'clk' => { |
'clk' => {}, |
'value' => 1, |
'0' => { |
'name' => 'clk' |
}, |
'type' => 'num' |
}, |
'wb_slave' => { |
'value' => 1, |
'0' => { |
'width' => 5, |
'name' => 'wb', |
'addr' => '0x9e00_0000 0x9eff_ffff IDE Controller' |
}, |
'type' => 'num', |
'wb_slave' => {} |
} |
}, |
'modules' => { |
'ext_int' => {} |
}, |
'parameters' => { |
'Aw' => { |
'info' => undef, |
11,20 → 50,27
'content' => '', |
'type' => 'Fixed' |
}, |
'TAGw' => { |
'SELw' => { |
'info' => undef, |
'deafult' => '3', |
'deafult' => '4', |
'global_param' => 0, |
'content' => '', |
'type' => 'Fixed' |
}, |
'SELw' => { |
'TAGw' => { |
'info' => undef, |
'deafult' => '4', |
'deafult' => '3', |
'global_param' => 0, |
'content' => '', |
'type' => 'Fixed' |
}, |
'Dw' => { |
'info' => undef, |
'deafult' => '32', |
'global_param' => 0, |
'content' => '', |
'type' => 'Fixed' |
}, |
'EXT_INT_NUM' => { |
'info' => 'number of external interrupt pins.', |
'deafult' => '3', |
31,148 → 77,102
'global_param' => 0, |
'content' => '1,32,1', |
'type' => 'Spin-button' |
}, |
'Dw' => { |
'info' => undef, |
'deafult' => '32', |
'global_param' => 0, |
'content' => '', |
'type' => 'Fixed' |
} |
} |
}, |
'modules' => { |
'ext_int' => {} |
}, |
'plugs' => { |
'clk' => { |
'clk' => {}, |
'0' => { |
'name' => 'clk' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'0' => { |
'name' => 'reset' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'interrupt_peripheral' => { |
'interrupt_peripheral' => {}, |
'0' => { |
'name' => 'interrupt' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'wb_slave' => { |
'0' => { |
'width' => 5, |
'name' => 'wb', |
'addr' => '0x9e00_0000 0x9eff_ffff IDE Controller' |
}, |
'value' => 1, |
'type' => 'num', |
'wb_slave' => {} |
} |
}, |
'ports' => { |
'sa_tag_i' => { |
'intfc_port' => 'tag_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'tag_i', |
'range' => 'TAGw-1 : 0', |
'type' => 'input' |
}, |
'sa_dat_o' => { |
'sa_rty_o' => { |
'intfc_port' => 'rty_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'dat_o', |
'range' => 'Dw-1 : 0', |
'range' => '', |
'type' => 'output' |
}, |
'sa_rty_o' => { |
'sa_dat_o' => { |
'intfc_port' => 'dat_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'rty_o', |
'range' => '', |
'range' => 'Dw-1 : 0', |
'type' => 'output' |
}, |
'sa_sel_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'sel_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'SELw-1 : 0', |
'type' => 'input' |
}, |
'sa_dat_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'dat_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'Dw-1 : 0', |
'type' => 'input' |
}, |
'ext_int_o' => { |
'intfc_name' => 'plug:interrupt_peripheral[0]', |
'intfc_port' => 'int_o', |
'intfc_name' => 'plug:interrupt_peripheral[0]', |
'range' => '', |
'type' => 'output' |
}, |
'sa_we_i' => { |
'intfc_port' => 'we_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'we_i', |
'range' => '', |
'type' => 'input' |
}, |
'sa_cyc_i' => { |
'intfc_port' => 'cyc_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'input' |
}, |
'sa_err_o' => { |
'intfc_port' => 'err_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'err_o', |
'range' => '', |
'type' => 'output' |
}, |
'sa_cyc_i' => { |
'sa_ack_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'cyc_i', |
'intfc_port' => 'ack_o', |
'range' => '', |
'type' => 'input' |
'type' => 'output' |
}, |
'ext_int_i' => { |
'intfc_name' => 'IO', |
'intfc_port' => 'IO', |
'range' => 'EXT_INT_NUM-1 : 0', |
'type' => 'input' |
}, |
'clk' => { |
'intfc_name' => 'plug:clk[0]', |
'intfc_port' => 'clk_i', |
'range' => '', |
'type' => 'input' |
}, |
'reset' => { |
'intfc_port' => 'reset_i', |
'intfc_name' => 'plug:reset[0]', |
'intfc_port' => 'reset_i', |
'range' => '', |
'type' => 'input' |
}, |
'clk' => { |
'intfc_port' => 'clk_i', |
'intfc_name' => 'plug:clk[0]', |
'range' => '', |
'type' => 'input' |
}, |
'ext_int_i' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => 'EXT_INT_NUM-1 : 0', |
'type' => 'input' |
}, |
'sa_ack_o' => { |
'intfc_port' => 'ack_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'output' |
}, |
'sa_addr_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'adr_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'Aw-1 : 0', |
'type' => 'input' |
}, |
'sa_stb_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'stb_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'input' |
} |
}, |
'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/ext_int/ext_int.v', |
'sockets' => {}, |
'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/ext_int/ext_int.v', |
'module_name' => 'ext_int', |
'unused' => { |
'plug:wb_slave[0]' => [ |
181,10 → 181,10
] |
}, |
'category' => 'interrupt', |
'header' => ' |
#define $IP_GER (*((volatile unsigned int *) ($BASE ))) |
#define $IP_IER_RISE (*((volatile unsigned int *) ($BASE+4 ))) |
#define $IP_IER_FALL (*((volatile unsigned int *) ($BASE+8 ))) |
#define $IP_ISR (*((volatile unsigned int *) ($BASE+12 ))) |
#define $IP_RD (*((volatile unsigned int *) ($BASE+16 )))' |
'system_h' => ' |
#define ${IP}_GER (*((volatile unsigned int *) ($BASE ))) |
#define ${IP}_IER_RISE (*((volatile unsigned int *) ($BASE+4 ))) |
#define ${IP}_IER_FALL (*((volatile unsigned int *) ($BASE+8 ))) |
#define ${IP}_ISR (*((volatile unsigned int *) ($BASE+12 ))) |
#define ${IP}_RD (*((volatile unsigned int *) ($BASE+16 )))' |
}, 'ip_gen' ); |
/ip/lm32.IP
340,5 → 340,5
'type' => 'input' |
} |
}, |
'header' => '#include "lm32_system.h"' |
'system_h' => '#include "lm32_system.h"' |
}, 'ip_gen' ); |
/ip/int_ctrl.IP
4,6 → 4,37
], |
'ip_name' => 'int_ctrl', |
'description' => 'interrupt controller', |
'modules' => { |
'int_ctrl' => {} |
}, |
'plugs' => { |
'clk' => { |
'clk' => {}, |
'0' => { |
'name' => 'clk' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'0' => { |
'name' => 'reset' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'wb_slave' => { |
'value' => 1, |
'0' => { |
'width' => 5, |
'name' => 'wb', |
'addr' => '0x9e00_0000 0x9eff_ffff IDE Controller' |
}, |
'type' => 'num', |
'wb_slave' => {} |
} |
}, |
'parameters' => { |
'Aw' => { |
'info' => undef, |
19,6 → 50,13
'content' => '', |
'type' => 'Fixed' |
}, |
'INT_NUM' => { |
'info' => 'number of inerrupt.', |
'deafult' => ' 3', |
'global_param' => 0, |
'content' => '1,32,1', |
'type' => 'Spin-button' |
}, |
'Dw' => { |
'info' => undef, |
'deafult' => ' 32', |
25,149 → 63,111
'global_param' => 0, |
'content' => '', |
'type' => 'Fixed' |
}, |
'INT_NUM' => { |
'info' => 'number of inerrupt.', |
'deafult' => ' 3', |
'global_param' => 0, |
'content' => '1,32,1', |
'type' => 'Spin-button' |
} |
} |
}, |
'plugs' => { |
'reset' => { |
'reset' => {}, |
'value' => 1, |
'0' => { |
'name' => 'reset' |
}, |
'type' => 'num' |
}, |
'clk' => { |
'clk' => {}, |
'value' => 1, |
'0' => { |
'name' => 'clk' |
}, |
'type' => 'num' |
}, |
'wb_slave' => { |
'0' => { |
'width' => 5, |
'name' => 'wb', |
'addr' => '0x9e00_0000 0x9eff_ffff IDE Controller' |
}, |
'value' => 1, |
'type' => 'num', |
'wb_slave' => {} |
} |
}, |
'modules' => { |
'int_ctrl' => {} |
}, |
'parameters_order' => [ |
'INT_NUM', |
'Dw', |
'Aw', |
'SELw' |
], |
'ports' => { |
'sa_dat_o' => { |
'sa_rty_o' => { |
'intfc_port' => 'rty_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'dat_o', |
'range' => 'Dw-1 : 0', |
'range' => '', |
'type' => 'output' |
}, |
'sa_rty_o' => { |
'sa_dat_o' => { |
'intfc_port' => 'dat_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'rty_o', |
'range' => '', |
'range' => 'Dw-1 : 0', |
'type' => 'output' |
}, |
'sa_sel_i' => { |
'intfc_port' => 'sel_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'sel_i', |
'range' => 'SELw-1 : 0', |
'type' => 'input' |
}, |
'sa_dat_i' => { |
'intfc_port' => 'dat_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'dat_i', |
'range' => 'Dw-1 : 0', |
'type' => 'input' |
}, |
'sa_we_i' => { |
'intfc_port' => 'we_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'we_i', |
'range' => '', |
'type' => 'input' |
}, |
'sa_err_o' => { |
'intfc_port' => 'err_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'err_o', |
'range' => '', |
'type' => 'output' |
}, |
'int_o' => { |
'intfc_port' => 'int_o', |
'intfc_name' => 'socket:interrupt_cpu[0]', |
'range' => '', |
'type' => 'output' |
}, |
'clk' => { |
'intfc_port' => 'clk_i', |
'intfc_name' => 'plug:clk[0]', |
'range' => '', |
'type' => 'input' |
}, |
'sa_ack_o' => { |
'intfc_port' => 'ack_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'ack_o', |
'range' => '', |
'type' => 'output' |
}, |
'reset' => { |
'intfc_port' => 'reset_i', |
'intfc_name' => 'plug:reset[0]', |
'intfc_port' => 'reset_i', |
'range' => '', |
'type' => 'input' |
}, |
'clk' => { |
'intfc_name' => 'plug:clk[0]', |
'intfc_port' => 'clk_i', |
'range' => '', |
'type' => 'input' |
}, |
'int_o' => { |
'intfc_name' => 'socket:interrupt_cpu[0]', |
'intfc_port' => 'int_o', |
'range' => '', |
'type' => 'output' |
}, |
'int_i' => { |
'intfc_port' => 'int_i', |
'intfc_name' => 'socket:interrupt_peripheral[array]', |
'intfc_port' => 'int_i', |
'range' => 'INT_NUM-1 : 0', |
'type' => 'input' |
}, |
'sa_addr_i' => { |
'intfc_port' => 'adr_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'adr_i', |
'range' => 'Aw-1 : 0', |
'type' => 'input' |
}, |
'sa_stb_i' => { |
'intfc_port' => 'stb_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'stb_i', |
'range' => '', |
'type' => 'input' |
} |
}, |
'parameters_order' => [ |
'INT_NUM', |
'Dw', |
'Aw', |
'SELw' |
], |
'sockets' => { |
'interrupt_cpu' => { |
'interrupt_cpu' => {}, |
'connection_num' => 'single connection', |
'value' => 1, |
'0' => { |
'name' => 'int_cpu' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'interrupt_peripheral' => { |
'interrupt_peripheral' => {}, |
'connection_num' => 'single connection', |
'interrupt_peripheral' => {}, |
'value' => 'INT_NUM', |
'0' => { |
'name' => 'int_periph' |
}, |
'value' => 'INT_NUM', |
'type' => 'param' |
} |
}, |
182,9 → 182,9
] |
}, |
'category' => 'interrupt', |
'header' => ' |
#define $IP_MER (*((volatile unsigned int *) ($BASE ))) |
#define $IP_IER (*((volatile unsigned int *) ($BASE+4 ))) |
#define $IP_IAR (*((volatile unsigned int *) ($BASE+8 ))) |
#define $IP_IPR (*((volatile unsigned int *) ($BASE+12 )))' |
'system_h' => ' |
#define ${IP}_MER (*((volatile unsigned int *) ($BASE ))) |
#define ${IP}_IER (*((volatile unsigned int *) ($BASE+4 ))) |
#define ${IP}_IAR (*((volatile unsigned int *) ($BASE+8 ))) |
#define ${IP}_IPR (*((volatile unsigned int *) ($BASE+12 )))' |
}, 'ip_gen' ); |
/ip/gpi.IP
6,33 → 6,33
'description' => 'General inout port', |
'modules' => { |
'gpi' => {}, |
'gpo' => {}, |
'gpio' => {} |
'gpio' => {}, |
'gpo' => {} |
}, |
'plugs' => { |
'clk' => { |
'clk' => {}, |
'0' => { |
'name' => 'clk' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'value' => 1, |
'0' => { |
'name' => 'reset' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'clk' => { |
'clk' => {}, |
'value' => 1, |
'0' => { |
'name' => 'clk' |
}, |
'type' => 'num' |
}, |
'wb_slave' => { |
'value' => 1, |
'0' => { |
'width' => 5, |
'name' => 'wb', |
'addr' => '0x9100_0000 0x91ff_ffff General-Purpose I/O' |
}, |
'value' => 1, |
'type' => 'num', |
'wb_slave' => {} |
} |
52,16 → 52,16
'content' => '', |
'type' => 'Fixed' |
}, |
'TAGw' => { |
'SELw' => { |
'info' => undef, |
'deafult' => ' 3', |
'deafult' => ' 4', |
'global_param' => 0, |
'content' => '', |
'type' => 'Fixed' |
}, |
'SELw' => { |
'TAGw' => { |
'info' => undef, |
'deafult' => ' 4', |
'deafult' => ' 3', |
'global_param' => 0, |
'content' => '', |
'type' => 'Fixed' |
76,86 → 76,86
}, |
'ports' => { |
'sa_tag_i' => { |
'intfc_port' => 'tag_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'tag_i', |
'range' => 'TAGw-1 : 0', |
'type' => 'input' |
}, |
'sa_dat_o' => { |
'intfc_port' => 'dat_o', |
'sa_rty_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'Dw-1 : 0', |
'intfc_port' => 'rty_o', |
'range' => '', |
'type' => 'output' |
}, |
'sa_rty_o' => { |
'intfc_port' => 'rty_o', |
'sa_dat_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'intfc_port' => 'dat_o', |
'range' => 'Dw-1 : 0', |
'type' => 'output' |
}, |
'sa_sel_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'sel_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'SELw-1 : 0', |
'type' => 'input' |
}, |
'sa_dat_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'dat_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'Dw-1 : 0', |
'type' => 'input' |
}, |
'sa_we_i' => { |
'intfc_port' => 'we_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'we_i', |
'range' => '', |
'type' => 'input' |
}, |
'sa_err_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'err_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'output' |
}, |
'sa_cyc_i' => { |
'intfc_port' => 'cyc_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'cyc_i', |
'range' => '', |
'type' => 'input' |
}, |
'sa_ack_o' => { |
'intfc_port' => 'ack_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'output' |
}, |
'reset' => { |
'intfc_port' => 'reset_i', |
'intfc_name' => 'plug:reset[0]', |
'range' => '', |
'type' => 'input' |
}, |
'clk' => { |
'intfc_name' => 'plug:clk[0]', |
'intfc_port' => 'clk_i', |
'intfc_name' => 'plug:clk[0]', |
'range' => '', |
'type' => 'input' |
}, |
'reset' => { |
'intfc_name' => 'plug:reset[0]', |
'intfc_port' => 'reset_i', |
'range' => '', |
'type' => 'input' |
}, |
'sa_ack_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'ack_o', |
'range' => '', |
'type' => 'output' |
}, |
'port_i' => { |
'intfc_name' => 'IO', |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => 'PORT_WIDTH-1 : 0', |
'type' => 'input' |
}, |
'sa_addr_i' => { |
'intfc_port' => 'adr_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'adr_i', |
'range' => 'Aw-1 : 0', |
'type' => 'input' |
}, |
'sa_stb_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'stb_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'input' |
} |
177,11 → 177,6
] |
}, |
'category' => 'GPI', |
'header' => ' |
|
|
#define $IP_READ_REG (*((volatile unsigned int *) ($BASE+8))) |
|
|
#define $IP_READ() $IP_READ_REG ' |
'system_h' => '#define ${IP}_READ_REG (*((volatile unsigned int *) ($BASE+8))) |
#define ${IP}_READ() ${IP}_READ_REG ' |
}, 'ip_gen' ); |
/ip/timer.IP
3,46 → 3,24
'/mpsoc/src_peripheral/timer/timer.v' |
], |
'ip_name' => 'timer', |
'parameters_order' => [ |
'CNTw', |
'Dw', |
'Aw', |
'TAGw', |
'SELw' |
], |
'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/timer/timer.v', |
'sockets' => {}, |
'module_name' => 'timer', |
'unused' => { |
'plug:wb_slave[0]' => [ |
'cti_i', |
'bte_i' |
] |
}, |
'category' => 'TIM', |
'description' => '32 bit timer ', |
'modules' => { |
'timer' => {} |
}, |
'plugs' => { |
'interrupt_peripheral' => { |
'interrupt_peripheral' => {}, |
'0' => { |
'name' => 'interrupt_peripheral' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'value' => 1, |
'0' => { |
'name' => 'reset' |
}, |
'type' => 'num' |
}, |
'clk' => { |
'clk' => {}, |
'value' => 1, |
'0' => { |
'name' => 'clk' |
}, |
'type' => 'num' |
}, |
'wb_slave' => { |
'0' => { |
'width' => 5, |
'name' => 'wb', |
'addr' => '0x9600_0000 0x96ff_ffff PWM/Timer/Counter Ctrl' |
}, |
'value' => 1, |
'type' => 'num', |
'wb_slave' => {} |
} |
}, |
'parameters' => { |
'Aw' => { |
'info' => undef, |
51,6 → 29,13
'content' => '', |
'type' => 'Fixed' |
}, |
'SELw' => { |
'info' => undef, |
'deafult' => ' 4', |
'global_param' => undef, |
'content' => '', |
'type' => 'Fixed' |
}, |
'TAGw' => { |
'info' => undef, |
'deafult' => '3', |
58,9 → 43,9
'content' => '', |
'type' => 'Fixed' |
}, |
'SELw' => { |
'CNTw' => { |
'info' => undef, |
'deafult' => ' 4', |
'deafult' => '32 ', |
'global_param' => undef, |
'content' => '', |
'type' => 'Fixed' |
71,119 → 56,134
'global_param' => undef, |
'content' => '', |
'type' => 'Fixed' |
}, |
'CNTw' => { |
'info' => undef, |
'deafult' => '32 ', |
'global_param' => undef, |
'content' => '', |
'type' => 'Fixed' |
} |
} |
}, |
'parameters_order' => [ |
'CNTw', |
'Dw', |
'Aw', |
'TAGw', |
'SELw' |
], |
'plugs' => { |
'clk' => { |
'clk' => {}, |
'0' => { |
'name' => 'clk' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'0' => { |
'name' => 'reset' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'interrupt_peripheral' => { |
'interrupt_peripheral' => {}, |
'value' => 1, |
'0' => { |
'name' => 'interrupt_peripheral' |
}, |
'type' => 'num' |
}, |
'wb_slave' => { |
'value' => 1, |
'0' => { |
'width' => 5, |
'name' => 'wb', |
'addr' => '0x9600_0000 0x96ff_ffff PWM/Timer/Counter Ctrl' |
}, |
'type' => 'num', |
'wb_slave' => {} |
} |
}, |
'modules' => { |
'timer' => {} |
}, |
'ports' => { |
'sa_tag_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'tag_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'TAGw-1 : 0', |
'type' => 'input' |
}, |
'sa_rty_o' => { |
'intfc_port' => 'rty_o', |
'sa_dat_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'intfc_port' => 'dat_o', |
'range' => 'Dw-1 : 0', |
'type' => 'output' |
}, |
'sa_dat_o' => { |
'intfc_port' => 'dat_o', |
'sa_rty_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'Dw-1 : 0', |
'intfc_port' => 'rty_o', |
'range' => '', |
'type' => 'output' |
}, |
'sa_sel_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'sel_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'SELw-1 : 0', |
'type' => 'input' |
}, |
'sa_dat_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'dat_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'Dw-1 : 0', |
'type' => 'input' |
}, |
'sa_we_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'we_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'input' |
}, |
'irq' => { |
'intfc_name' => 'plug:interrupt_peripheral[0]', |
'intfc_port' => 'int_o', |
'intfc_name' => 'plug:interrupt_peripheral[0]', |
'range' => '', |
'type' => 'output' |
}, |
'sa_cyc_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'cyc_i', |
'range' => '', |
'type' => 'input' |
}, |
'sa_err_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'err_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'output' |
}, |
'sa_cyc_i' => { |
'intfc_port' => 'cyc_i', |
'sa_ack_o' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'ack_o', |
'range' => '', |
'type' => 'input' |
'type' => 'output' |
}, |
'reset' => { |
'intfc_name' => 'plug:reset[0]', |
'intfc_port' => 'reset_i', |
'range' => '', |
'type' => 'input' |
}, |
'clk' => { |
'intfc_name' => 'plug:clk[0]', |
'intfc_port' => 'clk_i', |
'intfc_name' => 'plug:clk[0]', |
'range' => '', |
'type' => 'input' |
}, |
'reset' => { |
'intfc_port' => 'reset_i', |
'intfc_name' => 'plug:reset[0]', |
'range' => '', |
'type' => 'input' |
}, |
'sa_ack_o' => { |
'intfc_port' => 'ack_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'output' |
}, |
'sa_addr_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'adr_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => 'Aw-1 : 0', |
'type' => 'input' |
}, |
'sa_stb_i' => { |
'intfc_name' => 'plug:wb_slave[0]', |
'intfc_port' => 'stb_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'input' |
} |
}, |
'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/timer/timer.v', |
'sockets' => {}, |
'module_name' => 'timer', |
'unused' => { |
'plug:wb_slave[0]' => [ |
'cti_i', |
'bte_i' |
] |
}, |
'category' => 'TIM', |
'header' => '#define $IP_TCSR0 (*((volatile unsigned int *) ($BASE ))) |
'system_h' => '#define ${IP}_TCSR0 (*((volatile unsigned int *) ($BASE ))) |
|
/* |
//timer control register |
195,8 → 195,8
1 : int_enble_on_cmp_value |
0 : timer enable |
*/ |
#define $IP_TLR0 (*((volatile unsigned int *) ($BASE+4 ))) |
#define $IP_TCMP0 (*((volatile unsigned int *) ($BASE+8 ))) |
#define ${IP}_TLR0 (*((volatile unsigned int *) ($BASE+4 ))) |
#define ${IP}_TCMP0 (*((volatile unsigned int *) ($BASE+8 ))) |
#ifndef TIMER_EN |
#define TIMER_EN (1 << 0) |
#define TIMER_INT_EN (1 << 1) |
/ip/ethmac_100.IP
0,0 → 1,451
$ethtop = bless( { |
'hdl_files' => [ |
'/mpsoc/src_peripheral/ethmac/rtl/eth_clockgen.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_cop.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_crc.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_fifo.v', |
'/mpsoc/src_peripheral/ethmac/rtl/ethmac.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_maccontrol.v', |
'/mpsoc/src_peripheral/ethmac/rtl/ethmac_defines.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_macstatus.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_miim.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_outputcontrol.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_random.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_receivecontrol.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_register.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_registers.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_rxaddrcheck.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_rxcounters.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_rxethmac.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_rxstatem.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_shiftreg.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_spram_256x32.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_top.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_transmitcontrol.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_txcounters.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_txethmac.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_txstatem.v', |
'/mpsoc/src_peripheral/ethmac/rtl/eth_wishbone.v', |
'/mpsoc/src_peripheral/ethmac/rtl/timescale.v', |
'/mpsoc/src_peripheral/ethmac/rtl/xilinx_dist_ram_16x32.v', |
'/mpsoc/src_peripheral/ram/general_single_port_ram.v', |
'/mpsoc/src_peripheral/ram/general_dual_port_ram.v', |
'/mpsoc/src_peripheral/ethmac/ethtop.v' |
], |
'custom_file' => { |
'0' => {} |
}, |
'system_h' => ' |
|
void ${IP}_init(); |
void ${IP}_interrupt(); |
void ${IP}_recv_ack(void); |
int ${IP}_send(int length); //return (-1) or length (still processing previous) or asserted |
|
#define ${IP}_BASE_ADDR $BASE |
#define ${IP}_MODER (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x00 ))) |
#define ${IP}_INT_SOURCE (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x04 ))) |
#define ${IP}_INT_MASK (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x08 ))) |
#define ${IP}_IPGT (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x0C ))) |
#define ${IP}_IPGR1 (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x10 ))) |
#define ${IP}_IPGR2 (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x14 ))) |
#define ${IP}_PACKETLEN (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x18 ))) |
#define ${IP}_COLLCONF (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x1C ))) |
#define ${IP}_TX_BD_NUM (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x20 ))) |
#define ${IP}_CTRLMODER (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x24 ))) |
#define ${IP}_MIIMODER (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x28 ))) |
#define ${IP}_MIICOMMAND (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x2C ))) |
#define ${IP}_MIIADDR (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x30 ))) |
#define ${IP}_MIITX_DATA (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x34 ))) |
#define ${IP}_MIIRX_DATA (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x38 ))) |
#define ${IP}_MIISTATUS (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x3C ))) |
#define ${IP}_MAC_ADDR0 (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x40 ))) |
#define ${IP}_MAC_ADDR1 (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x44 ))) |
#define ${IP}_HASH0_ADR (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x48 ))) |
#define ${IP}_HASH1_ADR (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x4C ))) |
#define ${IP}_TXCTRL (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x50 ))) |
#define ${IP}_TXBD0H (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x404 ))) |
#define ${IP}_TXBD0L (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x400 ))) |
#define ${IP}_RXBD0H (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x604 ))) //this depends on TX_BD_NUM but this is the standard value |
#define ${IP}_RXBD0L (*((volatile unsigned int *) (${IP}_BASE_ADDR+0x600 ))) //this depends on TX_BD_NUM but this is the standard value |
|
|
#include "${IP}.h"', |
'ip_name' => 'ethmac_100', |
'custom_file_num' => 1, |
'ports_order' => [ |
'wb_clk_i', |
'wb_rst_i', |
'wb_dat_i', |
'wb_dat_o', |
'wb_adr_i', |
'wb_sel_i', |
'wb_we_i', |
'wb_cyc_i', |
'wb_stb_i', |
'wb_ack_o', |
'wb_err_o', |
'm_wb_adr_o', |
'm_wb_sel_o', |
'm_wb_we_o', |
'm_wb_dat_o', |
'm_wb_dat_i', |
'm_wb_cyc_o', |
'm_wb_stb_o', |
'm_wb_ack_i', |
'm_wb_err_i', |
'mtx_clk_pad_i', |
'mtxd_pad_o', |
'mtxen_pad_o', |
'mtxerr_pad_o', |
'mrx_clk_pad_i', |
'mrxd_pad_i', |
'mrxdv_pad_i', |
'mrxerr_pad_i', |
'mcoll_pad_i', |
'mcrs_pad_i', |
'mdc_pad_o', |
'md_pad_i', |
'md_pad_o', |
'md_padoe_o', |
'int_o' |
], |
'parameters_order' => [ |
'TX_FIFO_DATA_WIDTH', |
'TX_FIFO_DEPTH', |
'TX_FIFO_CNT_WIDTH', |
'RX_FIFO_DATA_WIDTH', |
'RX_FIFO_DEPTH', |
'RX_FIFO_CNT_WIDTH' |
], |
'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/ethmac/ethtop.v', |
'module_name' => 'ethtop', |
'gen_sw_files' => [ |
'/mpsoc/src_peripheral/ethmac/ethfrename_sep_t${IP}.h' |
], |
'unused' => { |
'plug:wb_slave[0]' => [ |
'rty_o', |
'tag_i', |
'cti_i', |
'bte_i' |
], |
'plug:wb_master[0]' => [ |
'tag_o', |
'bte_o', |
'cti_o', |
'rty_i' |
] |
}, |
'category' => 'eth', |
'sw_files' => [], |
'parameters' => { |
'RX_FIFO_DEPTH' => { |
'info' => undef, |
'deafult' => ' 16', |
'global_param' => 0, |
'content' => '', |
'redefine_param' => 1, |
'type' => 'Fixed' |
}, |
'TX_FIFO_DATA_WIDTH' => { |
'info' => undef, |
'deafult' => ' 32', |
'global_param' => 0, |
'content' => '', |
'redefine_param' => 1, |
'type' => 'Fixed' |
}, |
'RX_FIFO_DATA_WIDTH' => { |
'info' => undef, |
'deafult' => ' 32', |
'global_param' => 0, |
'content' => '', |
'redefine_param' => 1, |
'type' => 'Fixed' |
}, |
'RX_FIFO_CNT_WIDTH' => { |
'info' => undef, |
'deafult' => ' 5', |
'global_param' => 0, |
'content' => '', |
'redefine_param' => 1, |
'type' => 'Fixed' |
}, |
'TX_FIFO_CNT_WIDTH' => { |
'info' => undef, |
'deafult' => ' 5', |
'global_param' => 0, |
'content' => '', |
'redefine_param' => 1, |
'type' => 'Fixed' |
}, |
'TX_FIFO_DEPTH' => { |
'info' => undef, |
'deafult' => ' 16', |
'global_param' => 0, |
'content' => '', |
'redefine_param' => 1, |
'type' => 'Fixed' |
} |
}, |
'modules' => { |
'ethtop' => {} |
}, |
'plugs' => { |
'wb_master' => { |
'wb_master' => {}, |
'0' => { |
'name' => 'wb_master' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'interrupt_peripheral' => { |
'interrupt_peripheral' => {}, |
'0' => { |
'name' => 'interrupt_peripheral' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'0' => { |
'name' => 'reset' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'clk' => { |
'clk' => {}, |
'0' => { |
'name' => 'clk' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'wb_slave' => { |
'0' => { |
'width' => 11, |
'name' => 'wb_slave', |
'addr' => '0x9200_0000 0x92ff_ffff Ethernet Controller' |
}, |
'value' => 1, |
'type' => 'num', |
'wb_slave' => {} |
} |
}, |
'ports' => { |
'wb_sel_i' => { |
'intfc_port' => 'sel_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '3:0', |
'type' => 'input' |
}, |
'm_wb_we_o' => { |
'intfc_port' => 'we_o', |
'intfc_name' => 'plug:wb_master[0]', |
'range' => '', |
'type' => 'output' |
}, |
'wb_we_i' => { |
'intfc_port' => 'we_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'input' |
}, |
'wb_err_o' => { |
'intfc_port' => 'err_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'output' |
}, |
'wb_dat_o' => { |
'intfc_port' => 'dat_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '31:0', |
'type' => 'output' |
}, |
'wb_rst_i' => { |
'intfc_port' => 'reset_i', |
'intfc_name' => 'plug:reset[0]', |
'range' => '', |
'type' => 'input' |
}, |
'wb_cyc_i' => { |
'intfc_port' => 'cyc_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'input' |
}, |
'm_wb_err_i' => { |
'intfc_port' => 'err_i', |
'intfc_name' => 'plug:wb_master[0]', |
'range' => '', |
'type' => 'input' |
}, |
'm_wb_dat_i' => { |
'intfc_port' => 'dat_i', |
'intfc_name' => 'plug:wb_master[0]', |
'range' => '31:0', |
'type' => 'input' |
}, |
'mdc_pad_o' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'output' |
}, |
'm_wb_sel_o' => { |
'intfc_port' => 'sel_o', |
'intfc_name' => 'plug:wb_master[0]', |
'range' => '3:0', |
'type' => 'output' |
}, |
'md_pad_i' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'input' |
}, |
'mcrs_pad_i' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'input' |
}, |
'm_wb_dat_o' => { |
'intfc_port' => 'dat_o', |
'intfc_name' => 'plug:wb_master[0]', |
'range' => '31:0', |
'type' => 'output' |
}, |
'md_padoe_o' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'output' |
}, |
'wb_adr_i' => { |
'intfc_port' => 'adr_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '9:0', |
'type' => 'input' |
}, |
'm_wb_adr_o' => { |
'intfc_port' => 'adr_o', |
'intfc_name' => 'plug:wb_master[0]', |
'range' => '31:0', |
'type' => 'output' |
}, |
'mrxerr_pad_i' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'input' |
}, |
'mrxd_pad_i' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '3:0', |
'type' => 'input' |
}, |
'mtxd_pad_o' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '3:0', |
'type' => 'output' |
}, |
'wb_ack_o' => { |
'intfc_port' => 'ack_o', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'output' |
}, |
'mtxen_pad_o' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'output' |
}, |
'mcoll_pad_i' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'input' |
}, |
'int_o' => { |
'intfc_port' => 'int_o', |
'intfc_name' => 'plug:interrupt_peripheral[0]', |
'range' => '', |
'type' => 'output' |
}, |
'm_wb_ack_i' => { |
'intfc_port' => 'ack_i', |
'intfc_name' => 'plug:wb_master[0]', |
'range' => '', |
'type' => 'input' |
}, |
'wb_stb_i' => { |
'intfc_port' => 'stb_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '', |
'type' => 'input' |
}, |
'mrx_clk_pad_i' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'input' |
}, |
'wb_clk_i' => { |
'intfc_port' => 'clk_i', |
'intfc_name' => 'plug:clk[0]', |
'range' => '', |
'type' => 'input' |
}, |
'md_pad_o' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'output' |
}, |
'm_wb_cyc_o' => { |
'intfc_port' => 'cyc_o', |
'intfc_name' => 'plug:wb_master[0]', |
'range' => '', |
'type' => 'output' |
}, |
'mrxdv_pad_i' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'input' |
}, |
'mtxerr_pad_o' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'output' |
}, |
'mtx_clk_pad_i' => { |
'intfc_port' => 'IO', |
'intfc_name' => 'IO', |
'range' => '', |
'type' => 'input' |
}, |
'm_wb_stb_o' => { |
'intfc_port' => 'stb_o', |
'intfc_name' => 'plug:wb_master[0]', |
'range' => '', |
'type' => 'output' |
}, |
'wb_dat_i' => { |
'intfc_port' => 'dat_i', |
'intfc_name' => 'plug:wb_slave[0]', |
'range' => '31:0', |
'type' => 'input' |
} |
} |
}, 'ip_gen' ); |
ip/ethmac_100.IP
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: ip/lcd_2x16.IP
===================================================================
--- ip/lcd_2x16.IP (revision 23)
+++ ip/lcd_2x16.IP (revision 24)
@@ -2,175 +2,189 @@
'hdl_files' => [
'/mpsoc/src_peripheral/display/lcd_2x16/lcd_2x16.v'
],
+ 'system_h' => '#define ${IP}_WR_CMD (*((volatile unsigned int *) ($BASE)))
+#define ${IP}_RD_CMD (*((volatile unsigned int *) ($BASE+4)))
+#define ${IP}_WR_DATA (*((volatile unsigned int *) ($BASE+8)))
+#define ${IP}_RD_DATA (*((volatile unsigned int *) ($BASE+16)))
+
+#define ${IP}_CLK_MHZ $CLK_MHZ
+
+#include "$IP.h"',
+ 'ip_name' => 'lcd_2x16',
+ 'sw_params_list' => [],
+ 'parameters_order' => [
+ 'Dw',
+ 'Aw',
+ 'CLK_MHZ'
+ ],
+ 'ports_order' => [
+ 'clk',
+ 'reset',
+ 's_dat_i',
+ 's_addr_i',
+ 's_stb_i',
+ 's_cyc_i',
+ 's_we_i',
+ 's_dat_o',
+ 's_ack_o',
+ 'lcd_en',
+ 'lcd_rs',
+ 'lcd_rw',
+ 'lcd_data'
+ ],
+ 'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/display/lcd_2x16/lcd_2x16.v',
+ 'module_name' => 'lcd_2x16',
+ 'gen_sw_files' => [
+ '/mpsoc/src_peripheral/display/lcd_2x16/lcd_2x16.hgenfrename_sep_t${IP}.h'
+ ],
+ 'unused' => {
+ 'plug:wb_slave[0]' => [
+ 'err_o',
+ 'rty_o',
+ 'tag_i',
+ 'cti_i',
+ 'sel_i',
+ 'bte_i'
+ ]
+ },
+ 'category' => 'Display',
+ 'sw_files' => [],
'description' => 'Alphabet Display LCD 2x16',
- 'ip_name' => 'lcd_2x16',
+ 'parameters' => {
+ 'Aw' => {
+ 'info' => undef,
+ 'deafult' => ' 2',
+ 'global_param' => 0,
+ 'content' => '',
+ 'redefine_param' => 1,
+ 'type' => 'Fixed'
+ },
+ 'Dw' => {
+ 'info' => undef,
+ 'deafult' => ' 8',
+ 'global_param' => 0,
+ 'content' => '',
+ 'redefine_param' => 1,
+ 'type' => 'Fixed'
+ },
+ 'CLK_MHZ' => {
+ 'info' => 'The LCD controller clock speed in MHZ. It will be used for measuring the lcd enable delay. You can define a larger value than the actual clk speed but not smaller.',
+ 'deafult' => '100',
+ 'global_param' => 0,
+ 'content' => '2,1000,2',
+ 'redefine_param' => 1,
+ 'type' => 'Spin-button'
+ }
+ },
+ 'modules' => {
+ 'lcd_2x16' => {}
+ },
'plugs' => {
+ 'reset' => {
+ 'reset' => {},
+ '0' => {
+ 'name' => 'reset'
+ },
+ 'value' => 1,
+ 'type' => 'num'
+ },
'clk' => {
'clk' => {},
- 'value' => 1,
'0' => {
'name' => 'clk'
},
+ 'value' => 1,
'type' => 'num'
},
- 'reset' => {
- 'reset' => {},
- 'value' => 1,
- '0' => {
- 'name' => 'reset'
- },
- 'type' => 'num'
- },
'wb_slave' => {
- 'value' => 1,
'0' => {
'width' => 5,
'name' => 'wb_slave',
'addr' => '0x9100_0000 0x91ff_ffff General-Purpose I/O'
},
+ 'value' => 1,
'type' => 'num',
'wb_slave' => {}
}
},
- 'modules' => {
- 'lcd_2x16' => {}
- },
- 'parameters' => {
- 'Aw' => {
- 'info' => undef,
- 'deafult' => ' 2',
- 'global_param' => 0,
- 'content' => '',
- 'type' => 'Fixed',
- 'redefine_param' => 1
- },
- 'Dw' => {
- 'info' => undef,
- 'deafult' => ' 8',
- 'global_param' => 0,
- 'content' => '',
- 'type' => 'Fixed',
- 'redefine_param' => 1
- }
- },
- 'ports_order' => [
- 'clk',
- 'reset',
- 's_dat_i',
- 's_addr_i',
- 's_stb_i',
- 's_cyc_i',
- 's_we_i',
- 's_dat_o',
- 's_ack_o',
- 'lcd_en',
- 'lcd_rs',
- 'lcd_rw',
- 'lcd_data'
- ],
'ports' => {
- 's_cyc_i' => {
+ 's_dat_i' => {
+ 'intfc_port' => 'dat_i',
'intfc_name' => 'plug:wb_slave[0]',
- 'intfc_port' => 'cyc_i',
- 'range' => '',
+ 'range' => 'Dw-1 : 0',
'type' => 'input'
},
- 's_dat_i' => {
+ 's_cyc_i' => {
+ 'intfc_port' => 'cyc_i',
'intfc_name' => 'plug:wb_slave[0]',
- 'intfc_port' => 'dat_i',
- 'range' => 'Dw-1 : 0',
+ 'range' => '',
'type' => 'input'
},
'lcd_en' => {
+ 'intfc_port' => 'IO',
'intfc_name' => 'IO',
- 'intfc_port' => 'IO',
'range' => '',
'type' => 'output'
},
's_ack_o' => {
+ 'intfc_port' => 'ack_o',
'intfc_name' => 'plug:wb_slave[0]',
- 'intfc_port' => 'ack_o',
'range' => '',
'type' => 'output'
},
's_we_i' => {
+ 'intfc_port' => 'we_i',
'intfc_name' => 'plug:wb_slave[0]',
- 'intfc_port' => 'we_i',
'range' => '',
'type' => 'input'
},
's_stb_i' => {
+ 'intfc_port' => 'stb_i',
'intfc_name' => 'plug:wb_slave[0]',
- 'intfc_port' => 'stb_i',
'range' => '',
'type' => 'input'
},
'lcd_data' => {
+ 'intfc_port' => 'IO',
'intfc_name' => 'IO',
- 'intfc_port' => 'IO',
'range' => ' 7: 0',
'type' => 'inout'
},
'lcd_rs' => {
+ 'intfc_port' => 'IO',
'intfc_name' => 'IO',
+ 'range' => '',
+ 'type' => 'output'
+ },
+ 'clk' => {
+ 'intfc_port' => 'clk_i',
+ 'intfc_name' => 'plug:clk[0]',
+ 'range' => '',
+ 'type' => 'input'
+ },
+ 'lcd_rw' => {
'intfc_port' => 'IO',
+ 'intfc_name' => 'IO',
'range' => '',
'type' => 'output'
},
'reset' => {
+ 'intfc_port' => 'reset_i',
'intfc_name' => 'plug:reset[0]',
- 'intfc_port' => 'reset_i',
'range' => '',
'type' => 'input'
},
- 'lcd_rw' => {
- 'intfc_name' => 'IO',
- 'intfc_port' => 'IO',
- 'range' => '',
- 'type' => 'output'
- },
- 'clk' => {
- 'intfc_name' => 'plug:clk[0]',
- 'intfc_port' => 'clk_i',
- 'range' => '',
- 'type' => 'input'
- },
+ 's_dat_o' => {
+ 'intfc_port' => 'dat_o',
+ 'intfc_name' => 'plug:wb_slave[0]',
+ 'range' => 'Dw-1 : 0',
+ 'type' => 'output'
+ },
's_addr_i' => {
+ 'intfc_port' => 'adr_i',
'intfc_name' => 'plug:wb_slave[0]',
- 'intfc_port' => 'adr_i',
'range' => 'Aw-1 : 0',
'type' => 'input'
- },
- 's_dat_o' => {
- 'intfc_name' => 'plug:wb_slave[0]',
- 'intfc_port' => 'dat_o',
- 'range' => 'Dw-1 : 0',
- 'type' => 'output'
- }
- },
- 'parameters_order' => [
- 'Dw',
- 'Aw'
- ],
- 'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/display/lcd_2x16/lcd_2x16.v',
- 'module_name' => 'lcd_2x16',
- 'unused' => {
- 'plug:wb_slave[0]' => [
- 'err_o',
- 'rty_o',
- 'tag_i',
- 'cti_i',
- 'sel_i',
- 'bte_i'
- ]
- },
- 'category' => 'Display',
- 'header' => '#define LCD_WR_CMD (*((volatile unsigned int *) ($BASE)))
-#define LCD_RD_CMD (*((volatile unsigned int *) ($BASE+4)))
-#define LCD_WR_DATA (*((volatile unsigned int *) ($BASE+8)))
-#define LCD_RD_DATA (*((volatile unsigned int *) ($BASE+16)))
-#include "lcd_2x16.h"',
- 'sw_files' => [
- '/mpsoc/src_peripheral/display/lcd_2x16/lcd_2x16.h'
- ]
+ }
+ }
}, 'ip_gen' );
Index: ip/gpo.IP
===================================================================
--- ip/gpo.IP (revision 23)
+++ ip/gpo.IP (revision 24)
@@ -5,29 +5,29 @@
'ip_name' => 'gpo',
'description' => 'General output port',
'plugs' => {
+ 'reset' => {
+ 'reset' => {},
+ 'value' => 1,
+ '0' => {
+ 'name' => 'reset'
+ },
+ 'type' => 'num'
+ },
'clk' => {
'clk' => {},
+ 'value' => 1,
'0' => {
'name' => 'clk'
},
- 'value' => 1,
'type' => 'num'
},
- 'reset' => {
- 'reset' => {},
- '0' => {
- 'name' => 'reset'
- },
- 'value' => 1,
- 'type' => 'num'
- },
'wb_slave' => {
- 'value' => 1,
'0' => {
'width' => 5,
'name' => 'wb',
'addr' => '0x9100_0000 0x91ff_ffff General-Purpose I/O'
},
+ 'value' => 1,
'type' => 'num',
'wb_slave' => {}
}
@@ -34,8 +34,8 @@
},
'modules' => {
'gpi' => {},
- 'gpo' => {},
- 'gpio' => {}
+ 'gpio' => {},
+ 'gpo' => {}
},
'parameters' => {
'PORT_WIDTH' => {
@@ -52,16 +52,16 @@
'content' => '',
'type' => 'Fixed'
},
- 'TAGw' => {
+ 'SELw' => {
'info' => undef,
- 'deafult' => ' 3',
+ 'deafult' => ' 4',
'global_param' => 0,
'content' => '',
'type' => 'Fixed'
},
- 'SELw' => {
+ 'TAGw' => {
'info' => undef,
- 'deafult' => ' 4',
+ 'deafult' => ' 3',
'global_param' => 0,
'content' => '',
'type' => 'Fixed'
@@ -76,86 +76,86 @@
},
'ports' => {
'sa_tag_i' => {
+ 'intfc_name' => 'plug:wb_slave[0]',
'intfc_port' => 'tag_i',
- 'intfc_name' => 'plug:wb_slave[0]',
'range' => 'TAGw-1 : 0',
'type' => 'input'
},
- 'sa_rty_o' => {
- 'intfc_port' => 'rty_o',
+ 'sa_dat_o' => {
'intfc_name' => 'plug:wb_slave[0]',
- 'range' => '',
+ 'intfc_port' => 'dat_o',
+ 'range' => 'Dw-1 : 0',
'type' => 'output'
},
- 'sa_dat_o' => {
- 'intfc_port' => 'dat_o',
+ 'sa_rty_o' => {
'intfc_name' => 'plug:wb_slave[0]',
- 'range' => 'Dw-1 : 0',
+ 'intfc_port' => 'rty_o',
+ 'range' => '',
'type' => 'output'
},
'sa_sel_i' => {
+ 'intfc_name' => 'plug:wb_slave[0]',
'intfc_port' => 'sel_i',
- 'intfc_name' => 'plug:wb_slave[0]',
'range' => 'SELw-1 : 0',
'type' => 'input'
},
'sa_dat_i' => {
+ 'intfc_name' => 'plug:wb_slave[0]',
'intfc_port' => 'dat_i',
- 'intfc_name' => 'plug:wb_slave[0]',
'range' => 'Dw-1 : 0',
'type' => 'input'
},
'port_o' => {
+ 'intfc_name' => 'IO',
'intfc_port' => 'IO',
- 'intfc_name' => 'IO',
'range' => 'PORT_WIDTH-1 : 0',
'type' => 'output'
},
'sa_we_i' => {
+ 'intfc_name' => 'plug:wb_slave[0]',
'intfc_port' => 'we_i',
- 'intfc_name' => 'plug:wb_slave[0]',
'range' => '',
'type' => 'input'
},
+ 'sa_cyc_i' => {
+ 'intfc_name' => 'plug:wb_slave[0]',
+ 'intfc_port' => 'cyc_i',
+ 'range' => '',
+ 'type' => 'input'
+ },
'sa_err_o' => {
+ 'intfc_name' => 'plug:wb_slave[0]',
'intfc_port' => 'err_o',
- 'intfc_name' => 'plug:wb_slave[0]',
'range' => '',
'type' => 'output'
},
- 'sa_cyc_i' => {
- 'intfc_port' => 'cyc_i',
+ 'sa_ack_o' => {
'intfc_name' => 'plug:wb_slave[0]',
+ 'intfc_port' => 'ack_o',
'range' => '',
- 'type' => 'input'
+ 'type' => 'output'
},
+ 'reset' => {
+ 'intfc_name' => 'plug:reset[0]',
+ 'intfc_port' => 'reset_i',
+ 'range' => '',
+ 'type' => 'input'
+ },
'clk' => {
+ 'intfc_name' => 'plug:clk[0]',
'intfc_port' => 'clk_i',
- 'intfc_name' => 'plug:clk[0]',
'range' => '',
'type' => 'input'
},
- 'reset' => {
- 'intfc_port' => 'reset_i',
- 'intfc_name' => 'plug:reset[0]',
- 'range' => '',
- 'type' => 'input'
- },
- 'sa_ack_o' => {
- 'intfc_port' => 'ack_o',
- 'intfc_name' => 'plug:wb_slave[0]',
- 'range' => '',
- 'type' => 'output'
- },
'sa_addr_i' => {
+ 'intfc_name' => 'plug:wb_slave[0]',
'intfc_port' => 'adr_i',
- 'intfc_name' => 'plug:wb_slave[0]',
'range' => 'Aw-1 : 0',
'type' => 'input'
},
'sa_stb_i' => {
+ 'intfc_name' => 'plug:wb_slave[0]',
'intfc_port' => 'stb_i',
- 'intfc_name' => 'plug:wb_slave[0]',
'range' => '',
'type' => 'input'
}
@@ -177,9 +177,8 @@
]
},
'category' => 'GPI',
- 'header' => '
- #define $IP\\_WRITE_REG (*((volatile unsigned int *) ($BASE+4)))
- #define $IP\\_WRITE(value) $IP\\_WRITE_REG=value
+ 'system_h' => '#define ${IP}_WRITE_REG (*((volatile unsigned int *) ($BASE+4)))
+#define ${IP}_WRITE(value) ${IP}_WRITE_REG=value
'
}, 'ip_gen' );
/ip/gpio.IP
2,6 → 2,13
'hdl_files' => [ |
'/mpsoc/src_peripheral/gpio/gpio.v' |
], |
'system_h' => '#define ${IP}_DIR_REG (*((volatile unsigned int *) ($BASE))) |
#define ${IP}_WRITE _REG (*((volatile unsigned int *) ($BASE+4))) |
#define ${IP}_READ_REG (*((volatile unsigned int *) ($BASE+8))) |
|
#define ${IP}_DIR_SET(value) ${IP}_DIR_REG=value |
#define ${IP}_WRITE(value) ${IP}_WRITE _REG=value |
#define ${IP}_READ() ${IP}_READ_REG ', |
'description' => 'General inout port', |
'ip_name' => 'gpio', |
'parameters' => { |
67,12 → 74,6
'gpio' => {}, |
'gpo' => {} |
}, |
'parameters_order' => [ |
'PORT_WIDTH', |
'Dw', |
'Aw', |
'SELw' |
], |
'ports' => { |
'sa_dat_o' => { |
'intfc_port' => 'dat_o', |
147,6 → 148,12
'type' => 'input' |
} |
}, |
'parameters_order' => [ |
'PORT_WIDTH', |
'Dw', |
'Aw', |
'SELw' |
], |
'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/gpio/gpio.v', |
'sockets' => {}, |
'module_name' => 'gpio', |
158,13 → 165,5
'bte_i' |
] |
}, |
'category' => 'GPI', |
'header' => ' |
#define $IP_DIR_REG (*((volatile unsigned int *) ($BASE))) |
#define $IP_WRITE _REG (*((volatile unsigned int *) ($BASE+4))) |
#define $IP_READ_REG (*((volatile unsigned int *) ($BASE+8))) |
|
#define $IP_DIR_SET(value) $IP_DIR_REG=value |
#define $IP_WRITE(value) $IP_WRITE _REG=value |
#define $IP_READ() $IP_READ_REG ' |
'category' => 'GPI' |
}, 'ip_gen' ); |
/ip/aeMB.IP
367,7 → 367,7
'module_name' => 'aeMB_top', |
'unused' => undef, |
'category' => 'Processor', |
'header' => ' #include <stdio.h> |
'system_h' => ' #include <stdio.h> |
#include <stdlib.h> |
#include "aemb/core.hh" ', |
'sw_files' => [ |
/ip/ni.IP
11,6 → 11,53
], |
'ip_name' => 'ni', |
'description' => 'Network interface', |
'modules' => { |
'ni' => {} |
}, |
'plugs' => { |
'wb_master' => { |
'wb_master' => {}, |
'value' => 1, |
'0' => { |
'name' => 'wb_master' |
}, |
'type' => 'num' |
}, |
'interrupt_peripheral' => { |
'interrupt_peripheral' => {}, |
'value' => 1, |
'0' => { |
'name' => 'int_peripheral' |
}, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'value' => 1, |
'0' => { |
'name' => 'reset' |
}, |
'type' => 'num' |
}, |
'clk' => { |
'clk' => {}, |
'0' => { |
'name' => 'clk' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'wb_slave' => { |
'value' => 1, |
'0' => { |
'width' => 5, |
'name' => 'wb_slave', |
'addr' => '0xb800_0000 0xbfff_ffff custom devices' |
}, |
'type' => 'num', |
'wb_slave' => {} |
} |
}, |
'parameters' => { |
'Dw' => { |
'info' => undef, |
189,88 → 236,28
'redefine_param' => 1 |
} |
}, |
'plugs' => { |
'wb_master' => { |
'wb_master' => {}, |
'value' => 1, |
'0' => { |
'name' => 'wb_master' |
}, |
'type' => 'num' |
}, |
'interrupt_peripheral' => { |
'interrupt_peripheral' => {}, |
'value' => 1, |
'0' => { |
'name' => 'int_peripheral' |
}, |
'type' => 'num' |
}, |
'reset' => { |
'reset' => {}, |
'value' => 1, |
'0' => { |
'name' => 'reset' |
}, |
'type' => 'num' |
}, |
'clk' => { |
'clk' => {}, |
'0' => { |
'name' => 'clk' |
}, |
'value' => 1, |
'type' => 'num' |
}, |
'wb_slave' => { |
'value' => 1, |
'0' => { |
'width' => 5, |
'name' => 'wb_slave', |
'addr' => '0xb800_0000 0xbfff_ffff custom devices' |
}, |
'type' => 'num', |
'wb_slave' => {} |
} |
}, |
'modules' => { |
'ni' => {} |
}, |
'ports_order' => [ |
'reset', |
'clk', |
'current_x', |
'current_y', |
'flit_out', |
'flit_out_wr', |
'credit_in', |
'flit_in', |
'flit_in_wr', |
'credit_out', |
's_dat_i', |
's_sel_i', |
's_addr_i', |
's_cti_i', |
's_stb_i', |
's_cyc_i', |
's_we_i', |
's_dat_o', |
's_ack_o', |
's_err_o', |
's_rty_o', |
'm_sel_o', |
'm_dat_o', |
'm_addr_o', |
'm_cti_o', |
'm_stb_o', |
'm_cyc_o', |
'm_we_o', |
'm_dat_i', |
'm_ack_i', |
'm_err_i', |
'm_rty_i', |
'irq' |
], |
'parameters_order' => [ |
'V', |
'P', |
'B', |
'NX', |
'NY', |
'Fpay', |
'TOPOLOGY', |
'ROUTE_TYPE', |
'ROUTE_NAME', |
'DEBUG_EN', |
'COMB_MEM_PTR_W', |
'COMB_PCK_SIZE_W', |
'Dw', |
'S_Aw', |
'M_Aw', |
'TAGw', |
'SELw', |
'Yw', |
'Fw', |
'Xw' |
], |
'ports' => { |
'm_addr_o' => { |
'intfc_port' => 'adr_o', |
471,28 → 458,41
'type' => 'output' |
} |
}, |
'parameters_order' => [ |
'V', |
'P', |
'B', |
'NX', |
'NY', |
'Fpay', |
'TOPOLOGY', |
'ROUTE_TYPE', |
'ROUTE_NAME', |
'DEBUG_EN', |
'COMB_MEM_PTR_W', |
'COMB_PCK_SIZE_W', |
'Dw', |
'S_Aw', |
'M_Aw', |
'TAGw', |
'SELw', |
'Yw', |
'Fw', |
'Xw' |
], |
'ports_order' => [ |
'reset', |
'clk', |
'current_x', |
'current_y', |
'flit_out', |
'flit_out_wr', |
'credit_in', |
'flit_in', |
'flit_in_wr', |
'credit_out', |
's_dat_i', |
's_sel_i', |
's_addr_i', |
's_cti_i', |
's_stb_i', |
's_cyc_i', |
's_we_i', |
's_dat_o', |
's_ack_o', |
's_err_o', |
's_rty_o', |
'm_sel_o', |
'm_dat_o', |
'm_addr_o', |
'm_cti_o', |
'm_stb_o', |
'm_cyc_o', |
'm_we_o', |
'm_dat_i', |
'm_ack_i', |
'm_err_i', |
'm_rty_i', |
'irq' |
], |
'sockets' => { |
'ni' => { |
'connection_num' => 'single connection', |
517,32 → 517,36
] |
}, |
'category' => 'NoC', |
'header' => ' #define $IP_CLASS_IN_HDR_WIDTH 8 |
#define $IP_DEST_IN_HDR_WIDTH 8 |
#define $IP_X_Y_IN_HDR_WIDTH 4 |
'system_h' => ' #define ${IP}_BASE_ADDR ${BASE} |
#define ${IP}_ST (*((volatile unsigned int *) (${IP}_BASE_ADDR ))) |
#define ${IP}_RD (*((volatile unsigned int *) (${IP}_BASE_ADDR+4 ))) |
#define ${IP}_WR (*((volatile unsigned int *) (${IP}_BASE_ADDR+8))) |
|
|
|
#define ${IP}_CLASS_IN_HDR_WIDTH 8 |
#define ${IP}_DEST_IN_HDR_WIDTH 8 |
#define ${IP}_X_Y_IN_HDR_WIDTH 4 |
|
#define $IP_BUSY (1<<0) |
#define $IP_WR_DONE (1<<1) |
#define $IP_RD_DONE (1<<2) |
#define $IP_RD_OVR_ERR (1<<3) |
#define $IP_RD_NPCK_ERR (1<<4) |
#define $IP_HAS_PCK (1<<5) |
#define $IP_ALL_VCS_FULL (1<<6) |
#define $IP_WR_DONE_INT_EN (1<<7) |
#define $IP_RD_DONE_INT_EN (1<<8) |
#define $IP_RSV_PCK_INT_EN (1<<9) |
#define $IP_WR_DONE_ISR (1<<10) |
#define $IP_RD_DONE_ISR (1<<11) |
#define $IP_RSV_PCK_ISR (1<<12) |
#define ${IP}_BUSY (1<<0) |
#define ${IP}_WR_DONE (1<<1) |
#define ${IP}_RD_DONE (1<<2) |
#define ${IP}_RD_OVR_ERR (1<<3) |
#define ${IP}_RD_NPCK_ERR (1<<4) |
#define ${IP}_HAS_PCK (1<<5) |
#define ${IP}_ALL_VCS_FULL (1<<6) |
#define ${IP}_WR_DONE_INT_EN (1<<7) |
#define ${IP}_RD_DONE_INT_EN (1<<8) |
#define ${IP}_RSV_PCK_INT_EN (1<<9) |
#define ${IP}_WR_DONE_ISR (1<<10) |
#define ${IP}_RD_DONE_ISR (1<<11) |
#define ${IP}_RSV_PCK_ISR (1<<12) |
|
|
|
#define $IP_PTR_WIDTH 20 |
#define $IP_PCK_SIZE_WIDTH 12 |
#define ${IP}_PTR_WIDTH 20 |
#define ${IP}_PCK_SIZE_WIDTH 12 |
|
#define $IP_ST (*((volatile unsigned int *) ($IP_BASE_ADDR ))) |
#define $IP_RD (*((volatile unsigned int *) ($IP_BASE_ADDR+4 ))) |
#define $IP_WR (*((volatile unsigned int *) ($IP_BASE_ADDR+8))) |
|
|
|
549,14 → 553,14
|
|
|
#define $IP_HDR_DEST_CORE_ADDR(DES_X, DES_Y) ((DES_X << $IP_X_Y_IN_HDR_WIDTH) | DES_Y)<<(2*$IP_X_Y_IN_HDR_WIDTH) |
#define $IP_HDR_CLASS(pck_class) (pck_class << ( $IP_DEST_IN_HDR_WIDTH+ (4* $IP_X_Y_IN_HDR_WIDTH))) |
#define ${IP}_HDR_DEST_CORE_ADDR(DES_X, DES_Y) ((DES_X << ${IP}_X_Y_IN_HDR_WIDTH) | DES_Y)<<(2*${IP}_X_Y_IN_HDR_WIDTH) |
#define ${IP}_HDR_CLASS(pck_class) (pck_class << ( ${IP}_DEST_IN_HDR_WIDTH+ (4* ${IP}_X_Y_IN_HDR_WIDTH))) |
|
|
#define $IP_wait_for_sending_pck() while (!($IP_ST & $IP_WR_DONE)) |
#define $IP_wait_for_reading_pck() while (!($IP_ST & $IP_RD_DONE)) |
#define ${IP}_wait_for_sending_pck() while (!(${IP}_ST & ${IP}_WR_DONE)) |
#define ${IP}_wait_for_reading_pck() while (!(${IP}_ST & ${IP}_RD_DONE)) |
|
#define $IP_wait_for_getting_pck() while (!($IP_ST & $IP_HAS_PCK)) |
#define ${IP}_wait_for_getting_pck() while (!(${IP}_ST & ${IP}_HAS_PCK)) |
|
/***************************************** |
void send_pck (unsigned int * pck_buffer, unsigned int data_size); |
567,10 → 571,10
unsigned int class |
|
****************************************/ |
inline void $IP_send_pck (unsigned int des_x, unsigned int des_y, volatile unsigned int * pck_buffer, unsigned int data_size, unsigned int pck_class){ |
pck_buffer [0] = $IP_HDR_DEST_CORE_ADDR(des_x, des_y) | $IP_HDR_CLASS(pck_class) ; |
$IP_WR = (unsigned int) (& pck_buffer [0]) + (data_size<<$IP_PTR_WIDTH); |
$IP_wait_for_sending_pck(); |
inline void ${IP}_send_pck (unsigned int des_x, unsigned int des_y, volatile unsigned int * pck_buffer, unsigned int data_size, unsigned int pck_class){ |
pck_buffer [0] = ${IP}_HDR_DEST_CORE_ADDR(des_x, des_y) | ${IP}_HDR_CLASS(pck_class) ; |
${IP}_WR = (unsigned int) (& pck_buffer [0]) + (data_size<<${IP}_PTR_WIDTH); |
${IP}_wait_for_sending_pck(); |
|
} |
|
579,8 → 583,8
save a received packet on pck_buffer |
unsigned int * pck_buffer: the buffer for storing the packet; The read data start from buff[1]; |
********************************************/ |
inline void $IP_save_pck (volatile unsigned int * pck_buffer, unsigned int buffer_size){ |
$IP_RD = (unsigned int) (& pck_buffer [0]) + (buffer_size<<$IP_PTR_WIDTH); |
$IP_wait_for_reading_pck(); |
inline void ${IP}_save_pck (volatile unsigned int * pck_buffer, unsigned int buffer_size){ |
${IP}_RD = (unsigned int) (& pck_buffer [0]) + (buffer_size<<${IP}_PTR_WIDTH); |
${IP}_wait_for_reading_pck(); |
}' |
}, 'ip_gen' ); |