On Saturday 16 August 2014 19:32:02 Drew Rogge did opine
And Gene did reply:
> Is there a way to associate logic component inputs with pins without
> using net and creating signals? The example on the Basic HAL Tutorial
> creates a signal when connecting parport.0.pin-11-in to and2.0.in0:
> 
> loadrt and2 count=
> addf and2.0 servo-thread
> 
> net my-sigin1 and2.0.in0 <= parport.0.pin-11-in
> net my-sigin2 and2.0.in1 <= parport.0.pin-12-in
> net both-on parport.0.pin-14-out <= and2.0.out
> 
> Unless the signals my-sigin1 and 2 are going to be used for debugging
> they seem superfluous.

They are not superfluous, they are assigned as the name of that particular 
net.

The 2nd argument (base zero counting), after the name of the net is 
usually the input to that net, but you can, 200 lines later in your hal 
file use a line:
net my-sigin1 some_other_module.in-1, and it will be treated as another 
place to send the originally selected signal to.

Personally I much prefer to state the above like this:

net     my-sigin1       parport.0.pin-11-in     and2.0.in0
net     my-sigin2       parport.0.pin-12-in     and2.0.in1
net     both-on         and2.0.out              parport.0.pin-14-out

That way, you don't have to check those => and <= to determine the signal 
source, it is always argv(2) in C parlance, (thats base zero counting) the 
3rd item listed on the line originally defining the net's name. The 4th, 
5th etc items on the line are all places where the output of that 
and2.0.out is connected to.

Coding style in the hal file is a personal choice, because it will accept 
either the order on the line, or the =<, =>. Both I believe work, but its 
easier for me to follow the logic if its in a fixed order as above.

That preference may be the result of the years accumulated on the wet ram 
too. :-)

> Drew

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS

------------------------------------------------------------------------------
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to