From jpream at maxtor.com Tue Apr 9 15:48:25 2002 From: jpream at maxtor.com (Jeff Pream) Date: Wed Aug 4 23:58:41 2004 Subject: [boulder.pm] General group question Message-ID: <3CB35399.97F4EF5E@maxtor.com> I'm having problems with a Perl script, but some knowledge of verilog is needed to fully understand what I'm attempting to do. Does anyone on this list have knowledge of verilog? Please reply. Thanks. From Jay.Kominek at colorado.edu Tue Apr 9 15:56:04 2002 From: Jay.Kominek at colorado.edu (Jay Kominek) Date: Wed Aug 4 23:58:41 2004 Subject: [boulder.pm] General group question In-Reply-To: <3CB35399.97F4EF5E@maxtor.com> Message-ID: On Tue, 9 Apr 2002, Jeff Pream wrote: > I'm having problems with a Perl script, but some knowledge of verilog is > needed to fully understand what I'm attempting to do. > > Does anyone on this list have knowledge of verilog? Please reply. I've got a little tiny bit of experience with HDLs. Hit the list with the problem, you never know who else is lurking about. (And who knows? Maybe they can figure it out without really knowing Verilog.) - Jay Kominek Plus ?a change, plus c'est la m?me chose From jpream at maxtor.com Tue Apr 9 16:53:46 2002 From: jpream at maxtor.com (Jeff Pream) Date: Wed Aug 4 23:58:41 2004 Subject: [boulder.pm] Perl Reference Problems (with a hint of verilog) Message-ID: <3CB362EA.28FB8E95@maxtor.com> A little back ground.. I have taken a verilog netlist and created a data structure (hash of hashes..) to allow me to easily check certain constructs within the netlist. The data structure looks something like this: $pointer->{$module}{"sub_mod"}{$submodule}{$inst}{$port} = $connected_wire; $pointer->{$module}{"clocks"}{$clock} = $arbitrary_number; #just need the name $pointer->{$module}{"port"}{"in"}{$port_name} = $arbitrary_number; #just need the name $pointer->{$module}{"port"}{"out"}{$port_name} = $arbitrary_number; #just need the name $pointer->{$module}{"port"}{"inout"}{$port_name} = $arbitrary_number; #just need the name $pointer->{$module}{"port"}{"unknown"}{$port_name} = $arbitrary_number; #module not declared @{$pointer->{$module}{"wire"}} = @wire_list_of_module; $pointer->{$module}{"used_by"}{$parent_module}{$inst_name}{$clk_port} = $connected_wire; #added after initial data struct built $pointer->{$module}{"declared"} = $arbitrary_number; #module is locally declared My current task is to map out the clocks within the design hierarchy. To do this I identify known clock ports within modules. For each module with a known clock port I find it's parent module and trace the wire connected to the clock port to any other sub-modules that use that wire. Once a sub-module that uses that wire is found, I add it's port (to which the wire is attached) and add it to: $pointer->{$module}{"used_by"}{$parent_module}{$inst_name}{$clk_port} = $connected_wire; (Note: $clk_port has entry does not exist until i do the $connected_wire assignment) The problem is, when I do the assignment, all the instances of all the modules end up with a key of $clk_port with a value of $connected_wire. All this after one (supposedly single assignment). Here is the subroutine that idenifies the parent clock and adds the clock to it's sub-modules: sub add_clock { my ($parent, $sub_mod, $inst, $clk_port, $vnet) = @_; print "Add Clock Data: $parent, $sub_mod, $inst, $clk_port\n"; my ($clock) = $vnet->{$parent}{"sub_mod"}{$sub_mod}{$inst}{$clk_port}; $vnet->{$parent}{"clocks"}{$clock}++; print "Added Parent Clock: $clock to $parent\n"; foreach my $sub_mod (keys %{$vnet->{$parent}{"sub_mod"}}) { foreach my $inst (keys %{$vnet->{$parent}{"sub_mod"}{$sub_mod}}) { foreach my $port (keys %{$vnet->{$parent}{"sub_mod"}{$sub_mod}{$inst}}) { my ($wire) = $vnet->{$parent}{"sub_mod"}{$sub_mod}{$inst}{$port}; if ($wire eq $clock) { &print_vnet ($vnet); print qq/Traced Wire: $wire to Inst: $inst Port: $port\n/; $vnet->{$sub_mod}{"used_by"}{$parent}{$inst}{$port} = $clock; &print_vnet ($vnet); &stop(); } } } } } Here's a sample output from the subroutine (&print_vnet unwinds elements of the data structure, &stop is a break point). Notice the first VNET CATALOG with no clock ports identified, then I identify CG_CLKOUT1 is connected to CK port of synth_cntl_reg_0A, then notice that both of the submodules suddenly have CK identified as clock ports connected to CG_CLKOUT1 when only one was assigned. Add Clock Data: cg_test_1, FL1S3ENV15, synth_cntl_reg_0A, CK Added Parent Clock: CG_CLKOUT1 to cg_test_1 VNET CATALOG: {FL1S3ENV15}{"clocks"} = CK {cg_test_1}{"sub_mod"}{FL1S3ENV15}{synth_cntl_reg_0A}{CK} = CG_CLKOUT1 {cg_test_1}{"sub_mod"}{FL1S2EQV15}{pwrdn_cnt_reg_15A}{CK} = xtal_clk {cg_test_1}{"clocks"} = CG_CLKOUT1 {FL1S2EQV15}{"clocks"} = CK Traced Wire: CG_CLKOUT1 to Inst: synth_cntl_reg_0A Port: CK VNET CATALOG: {FL1S3ENV15}{"used_by"}{cg_test_1}{synth_cntl_reg_0A}{CK} = CG_CLKOUT1 {FL1S3ENV15}{"clocks"} = CK {cg_test_1}{"sub_mod"}{FL1S3ENV15}{synth_cntl_reg_0A}{CK} = CG_CLKOUT1 {cg_test_1}{"sub_mod"}{FL1S2EQV15}{pwrdn_cnt_reg_15A}{CK} = xtal_clk {cg_test_1}{"clocks"} = CG_CLKOUT1 {FL1S2EQV15}{"used_by"}{cg_test_1}{pwrdn_cnt_reg_15A}{CK} = CG_CLKOUT1 {FL1S2EQV15}{"clocks"} = CK And here's the netlist I used: (obviously just for testing) module cg_test_1 (CG_CLKOUT1); output CG_CLKOUT1; wire xtal_clk; FL1S2EQV15 pwrdn_cnt_reg_15A (.CK(xtal_clk)); FL1S3ENV15 synth_cntl_reg_0A (.CK(CG_CLKOUT1)); endmodule This one's been bustin' my hump for a while.. Any ideas? If you want to go one on one, I can send you the entire script (pretty small). Thanks. From jpream at maxtor.com Tue Apr 9 17:16:16 2002 From: jpream at maxtor.com (Jeff Pream) Date: Wed Aug 4 23:58:41 2004 Subject: [boulder.pm] Perl Reference Problems (with a hint of verilog) References: <3CB362EA.28FB8E95@maxtor.com> Message-ID: <3CB36830.2642BED6@maxtor.com> Sorry about the word wrap.. If you'd like a non-wrapped version let me know and I'll repost. Jeff Pream wrote: > A little back ground.. I have taken a verilog netlist and created a > data structure (hash of hashes..) to allow me to easily check certain > constructs within the netlist. The data structure looks something like > this: > > $pointer->{$module}{"sub_mod"}{$submodule}{$inst}{$port} = > $connected_wire; > $pointer->{$module}{"clocks"}{$clock} = $arbitrary_number; #just need > the name > $pointer->{$module}{"port"}{"in"}{$port_name} = $arbitrary_number; #just > need the name > $pointer->{$module}{"port"}{"out"}{$port_name} = $arbitrary_number; > #just need the name > $pointer->{$module}{"port"}{"inout"}{$port_name} = $arbitrary_number; > #just need the name > $pointer->{$module}{"port"}{"unknown"}{$port_name} = $arbitrary_number; > #module not declared > @{$pointer->{$module}{"wire"}} = @wire_list_of_module; > $pointer->{$module}{"used_by"}{$parent_module}{$inst_name}{$clk_port} = > $connected_wire; #added after initial data struct built > $pointer->{$module}{"declared"} = $arbitrary_number; #module is locally > declared > > My current task is to map out the clocks within the design hierarchy. > To do this I identify known clock ports within modules. For each module > with a known clock port I find it's parent module and trace the wire > connected to the clock port to any other sub-modules that use that > wire. Once a sub-module that uses that wire is found, I add it's port > (to which the wire is attached) and add it to: > $pointer->{$module}{"used_by"}{$parent_module}{$inst_name}{$clk_port} = > $connected_wire; (Note: $clk_port has entry does not exist until i do > the $connected_wire assignment) > > The problem is, when I do the assignment, all the instances of all the > modules end up with a key of $clk_port with a value of $connected_wire. > All this after one (supposedly single assignment). > > Here is the subroutine that idenifies the parent clock and adds the > clock to it's sub-modules: > sub add_clock { > my ($parent, $sub_mod, $inst, $clk_port, $vnet) = @_; > print "Add Clock Data: $parent, $sub_mod, $inst, $clk_port\n"; > my ($clock) = > $vnet->{$parent}{"sub_mod"}{$sub_mod}{$inst}{$clk_port}; > $vnet->{$parent}{"clocks"}{$clock}++; > print "Added Parent Clock: $clock to $parent\n"; > foreach my $sub_mod (keys %{$vnet->{$parent}{"sub_mod"}}) { > foreach my $inst (keys %{$vnet->{$parent}{"sub_mod"}{$sub_mod}}) { > > foreach my $port (keys > %{$vnet->{$parent}{"sub_mod"}{$sub_mod}{$inst}}) { > my ($wire) = > $vnet->{$parent}{"sub_mod"}{$sub_mod}{$inst}{$port}; > if ($wire eq $clock) { > &print_vnet ($vnet); > print qq/Traced Wire: $wire to Inst: $inst Port: > $port\n/; > $vnet->{$sub_mod}{"used_by"}{$parent}{$inst}{$port} = > $clock; > &print_vnet ($vnet); > &stop(); > } > } > } > } > } > > Here's a sample output from the subroutine (&print_vnet unwinds > elements of the data structure, &stop is a break point). Notice the > first VNET CATALOG with no clock ports identified, then I identify > CG_CLKOUT1 is connected to CK port of synth_cntl_reg_0A, then notice > that both of the submodules suddenly have CK identified as clock ports > connected to CG_CLKOUT1 when only one was assigned. > > Add Clock Data: cg_test_1, FL1S3ENV15, synth_cntl_reg_0A, CK > Added Parent Clock: CG_CLKOUT1 to cg_test_1 > VNET CATALOG: > {FL1S3ENV15}{"clocks"} = CK > {cg_test_1}{"sub_mod"}{FL1S3ENV15}{synth_cntl_reg_0A}{CK} = > CG_CLKOUT1 > {cg_test_1}{"sub_mod"}{FL1S2EQV15}{pwrdn_cnt_reg_15A}{CK} = xtal_clk > > {cg_test_1}{"clocks"} = CG_CLKOUT1 > {FL1S2EQV15}{"clocks"} = CK > Traced Wire: CG_CLKOUT1 to Inst: synth_cntl_reg_0A Port: CK > VNET CATALOG: > {FL1S3ENV15}{"used_by"}{cg_test_1}{synth_cntl_reg_0A}{CK} = > CG_CLKOUT1 > {FL1S3ENV15}{"clocks"} = CK > {cg_test_1}{"sub_mod"}{FL1S3ENV15}{synth_cntl_reg_0A}{CK} = > CG_CLKOUT1 > {cg_test_1}{"sub_mod"}{FL1S2EQV15}{pwrdn_cnt_reg_15A}{CK} = xtal_clk > > {cg_test_1}{"clocks"} = CG_CLKOUT1 > {FL1S2EQV15}{"used_by"}{cg_test_1}{pwrdn_cnt_reg_15A}{CK} = > CG_CLKOUT1 > {FL1S2EQV15}{"clocks"} = CK > > And here's the netlist I used: (obviously just for testing) > module cg_test_1 (CG_CLKOUT1); > output CG_CLKOUT1; > wire xtal_clk; > FL1S2EQV15 pwrdn_cnt_reg_15A (.CK(xtal_clk)); > FL1S3ENV15 synth_cntl_reg_0A (.CK(CG_CLKOUT1)); > endmodule > > This one's been bustin' my hump for a while.. > > Any ideas? If you want to go one on one, I can send you the entire > script (pretty small). > > Thanks. From myke at komar.org Mon Apr 22 18:46:03 2002 From: myke at komar.org (Myke Komarnitsky) Date: Wed Aug 4 23:58:42 2004 Subject: [boulder.pm] environment vars from a cgi script In-Reply-To: <3CB362EA.28FB8E95@maxtor.com> Message-ID: <5.1.0.14.0.20020422174133.01e22ad0@199.117.52.25> This is more apache/unix than perl, but I'm doing it with a perl script. I have a small form that takes an email address, and has two boxes that can be checked. It then sends an email to me, including everything in the %in hash (where I put the input vars), @ARGV, and %ENV. my question: The %ENV hash has a CONTENT_LENGTH variable.... what I really want to see is the entire, unedited, untouched, content string passed to the script..... anyone know how to do this? thanks, Myke here's the existing output ---------- announce ==> yes discuss ==> yes email ==> the_input_email@earthlink.net ---------- here's @ARGV ---------- ---------- here's the %ENV vars ---------- CONTENT_LENGTH ==> 57 CONTENT_TYPE ==> application/x-www-form-urlencoded DOCUMENT_ROOT ==> /home/docs/climbing/boulder/live/ GATEWAY_INTERFACE ==> CGI/1.1 HTTP_ACCEPT ==> image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/pdf, */* HTTP_ACCEPT_ENCODING ==> gzip, deflate HTTP_ACCEPT_LANGUAGE ==> en-us HTTP_CACHE_CONTROL ==> no-cache HTTP_CONNECTION ==> Keep-Alive HTTP_HOST ==> www.climbingboulder.com HTTP_REFERER ==> http://www.climbingboulder.com/community/email.html HTTP_USER_AGENT ==> Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) PATH ==> /sbin:/bin:/usr/sbin:/usr/bin QUERY_STRING ==> REMOTE_ADDR ==> 165.127.14.155 REMOTE_PORT ==> 1560 REQUEST_METHOD ==> POST REQUEST_URI ==> /cgi-bin/emaillist.pl SCRIPT_FILENAME ==> /home/docs/climbing/cgi-bin/emaillist.pl SCRIPT_NAME ==> /cgi-bin/emaillist.pl SERVER_ADDR ==> 199.117.52.1 SERVER_ADMIN ==> myke@komar.org SERVER_NAME ==> www.climbingboulder.com SERVER_PORT ==> 80 SERVER_PROTOCOL ==> HTTP/1.1 SERVER_SIGNATURE ==>
Apache/1.3.20 Server at www.climbingboulder.com Port 80
SERVER_SOFTWARE ==> Apache/1.3.20 (Unix) mod_perl/1.26 PHP/4.0.6 AuthMySQL/2.20 mod_ssl/2.8.4 OpenSSL/0.9.6 Michael Komarnitsky Komar Consulting Group 303.818.3718 http://www.komar.biz http://climbingboulder.com http://myke.komar.org - From walter at frii.com Mon Apr 22 22:19:50 2002 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:42 2004 Subject: [boulder.pm] environment vars from a cgi script In-Reply-To: <5.1.0.14.0.20020422174133.01e22ad0@199.117.52.25> Message-ID: On Mon, 22 Apr 2002, Myke Komarnitsky wrote: > This is more apache/unix than perl, but I'm doing it with a perl script. > > I have a small form that takes an email address, and has two boxes that can > be checked. It then sends an email to me, including everything in the %in > hash (where I put the input vars), @ARGV, and %ENV. > > my question: The %ENV hash has a CONTENT_LENGTH variable.... what I really > want to see is the entire, unedited, untouched, content string passed to > the script..... anyone know how to do this? > > thanks, > Myke > > here's the existing output [snip] I don't follow what you're asking. When you say "content string passed to the script" I think QUERY_STRING, but that's not what you're after, I think, based on the output I saw. Sorry for being dense, but could you provide a really specific example of what exactly you're wanting to see? Walter From myke at komar.org Tue Apr 23 01:53:04 2002 From: myke at komar.org (Myke Komarnitsky) Date: Wed Aug 4 23:58:42 2004 Subject: [boulder.pm] environment vars from a cgi script In-Reply-To: References: <5.1.0.14.0.20020422174133.01e22ad0@199.117.52.25> Message-ID: <5.1.0.14.0.20020423005059.01e0a5c0@199.117.52.25> At 09:19 PM 4/22/2002 -0600, you wrote: >I don't follow what you're asking. When you say "content string passed >to the script" I think QUERY_STRING, but that's not what you're after, >I think, based on the output I saw. Sorry for being dense, but could >you provide a really specific example of what exactly you're wanting to >see? the data is passed via the method post.... however, if it was passed via GET, the url would look like /cgi-bin/emaillist.pl?email=the_email_address@domain.com&discuss=1&announce=0 what I want is everything after the ? .... well, wherever this string exists if it is a POST. Myke Michael Komarnitsky Komar Consulting Group 303.818.3718 http://www.komar.biz http://climbingboulder.com http://myke.komar.org - From speralta at peakpeak.com Tue Apr 23 09:49:49 2002 From: speralta at peakpeak.com (Salvador) Date: Wed Aug 4 23:58:42 2004 Subject: [boulder.pm] environment vars from a cgi script References: <5.1.0.14.0.20020422174133.01e22ad0@199.117.52.25> <5.1.0.14.0.20020423005059.01e0a5c0@199.117.52.25> Message-ID: <3CC5748D.5000700@peakpeak.com> Does this illustrate what you are looking for? #!/usr/bin/perl if ($ENV{'REQUEST_METHOD'} eq 'GET') { @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); } else { print "Content-type: text/html\n\n"; print "

Use Post or Get"; } Myke Komarnitsky wrote: > At 09:19 PM 4/22/2002 -0600, you wrote: > >> I don't follow what you're asking. When you say "content string passed >> to the script" I think QUERY_STRING, but that's not what you're after, >> I think, based on the output I saw. Sorry for being dense, but could >> you provide a really specific example of what exactly you're wanting to >> see? > > > the data is passed via the method post.... however, if it was passed via > GET, the url would look like > > /cgi-bin/emaillist.pl?email=the_email_address@domain.com&discuss=1&announce=0 > > what I want is everything after the ? .... well, wherever this string > exists if it is a POST. From myke at komar.org Tue Apr 23 10:12:01 2002 From: myke at komar.org (Myke Komarnitsky) Date: Wed Aug 4 23:58:42 2004 Subject: [boulder.pm] environment vars from a cgi script In-Reply-To: <3CC5748D.5000700@peakpeak.com> References: <5.1.0.14.0.20020422174133.01e22ad0@199.117.52.25> <5.1.0.14.0.20020423005059.01e0a5c0@199.117.52.25> Message-ID: <5.1.0.14.0.20020423091130.00ab4550@199.117.52.25> At 07:49 AM 4/23/2002 -0700, you wrote: >Does this illustrate what you are looking for? >} elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { > read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); > @pairs = split(/&/, $buffer); yup, exactly. thank you! Myke Michael Komarnitsky Komar Consulting Group 303.818.3718 http://www.komar.biz http://climbingboulder.com http://myke.komar.org -