explanation

vhdl

    Next

  • 1. doubt on VHDL process
    dear all i am having a doubt in vhdl process(....) if i define process(clk1,clk2) { ...... ....... } if 1st clk1 occured and if it takes 5 sec to complete whole process and if in 3rd sec clk2 has triggered. will the process stops in the middle and respond to clk2 or it will continue and respond to clk2 after end of process invoked by clk1
  • 2. locally static expression
    I looked this up once in the VHDL spec, but I don't recall the details. I seem to remember that the definition of a locally static expression is rather complex with a lot of little details. But a tool is flagging warnings on some code which seems to be due to the use of conversion from SLV to integer. constant SWAP : IRSLV := to_slv(FIXOP + 16#00#, 8); -- E0 (1110 0000) type INSTDSPLY is (RST, IACK, LTR, JMP, JUMZ, JUMC, JUMO, CALA, CALR, SWP, OVR, RUP, DUP, SHFL, SHFC, ZFLG, RFTC, RDRP, RTN, FTCH, FCHB, RFRM, RSB, RCM, FCHP, FHPB, RARS, DDRP, TOR, CPNC, CPC, ADNC, ADC, SBNC, SBC, BFL, RTI, STOR, STRB, BLAN, RADT, BLOR, STRP, STPB, BLXR); when TO_INTEGER(UNSIGNED(SWAP)) => return SWP; The warning comes from lines like this last one, allegedly from the value returned by the TO_INTEGER conversion. "Choice TO_INTEGER is not a locally static expression." I do this in a lot of places in some existing code. My MO is to avoid warning messages, so I can't believe that I would have done this and lived with the dozens of warnings I am getting. But then the older tool may not have been as true to the spec as it could have been. Rather than make me go dig up my copy of the VHDL spec and read all those cross-referenced paragraphs to re-learn what this really means, can anyone give me the 25 cent explanation and an easy cure?

explanation

Postby Mariusz » Wed, 14 Jan 2004 08:59:37 GMT

Hello. I'm new to VHDL. Could someone explain me what does the following
code snippet does? I completely don't get what is the generate clause for. I
wanted to look at the help file but help in my webpack seems to be broken
and it says that there is no such topic :(
This is very important to me to understand this code, becouse i have to use
it in my own program. And it's little difficulf for me to do this without
understanding...


TheBRAM: for i in DataIn'range generate
  signal ToLow, ToHigh : std_logic;
  type TData is array (DataIn'range) of std_logic_vector(0 downto 0);
  signal DataInArray : TData;
  signal DataOutArray : TData;
  signal FullAddress : std_logic_vector(11 downto 0);
  attribute init_00 : string;
  attribute init_00 of OneRAM : label is
   "FFFF" & "FFFF" & "FFFF" & "FFFF" & "FFFF" & "FFFF" & "FFFF" & "FFFF" &
   "FFFF" & "FFFF" & "FFFF" & "FFFF" & "FFFF" & "FFFF" & "FFFF" & "FFFF"
  ;
 begin
    ToLow <= '0';
    ToHigh <= '1';
    DataInArray(i)(0) <= DataIn(i);
    DataOut(i) <= DataOutArray(i)(0);

    DoFullAddress: for j in FullAddress'range generate
     AssignAddress: if  (j >= Address'low) and  (j <= Address'high) generate
       FullAddress(j) <= Address(j);
     end generate;
     AssignZero: if (j < Address'low) or  (j > Address'high)  generate
       FullAddress(j) <= '0';
     end generate;
    end generate DoFullAddress;

    OneRAM: RAMB4_S1 port map(
        WE=>WrEn,
        EN => ToHigh,
        RST => ToLow,
        Clk => Clk,
        Addr => FullAddress,
        DI=>DataInArray(i),
        DO=> DataOutArray(i)
    );
 end generate TheBRAM;



Re: explanation

Postby tbx135 » Wed, 14 Jan 2004 11:10:55 GMT

Generating and initializing some kind of block RAM component.





I
use
generate



Similar Threads:

1.Debug Off: Explanation

2.Pictured output for newbie :-( needing explanation ;-)

Dear Forthers,

I'm struggling with pictured output:

  15 0 <# #s #> type

should, as I understood, print '15'. It does in SwiftForth. But not in
Win32Forth (6.11.07) or in DX-Forth. Even though I'm practically a
beginner, I do know that 'if you know one Forth you know one Forth' ;-)
Is this an instance of this rule? Or what is my problem here?

This is just the simplest thing I cannot even get to run. What I wanted
to achieve is to convert seconds from the stack to hh:mm:ss, as
suggested on the web page of 'Starting Forth', which didn't work, so I
returned to something more fundamental ...

Cheers,
   Christoph.

3.Nice historical explanation of when and why term "closure" came into use

Benjamin Franksen schrieb:
> Joachim Durchholz wrote:
>> A really silly case is "monadic I/O". That's just like characterizing
>> multiplication as "associative number combination" - it's true, and
>> captures one property of the whole mechanism, but certainly not the most
>> relevant aspect.
> 
> I have to disagree. IMO it /is/ the most relevant aspect, as soon as you
> take the representation of 'primitive' I/O actions as an abstract data type
> for granted.
> 
> Why? First note that the primitive action values would be (almost) useless
> without a way to sequence them together to form programs.
> 
> The astonishing fact is that the monad combinators and the corresponding
> laws are /exactly/ what is required to precisely capture the essence of how
> sequencing works in any imperative programming language.

Sure. But I/O is more than just sequencing - and that isn't surprising: 
if it were otherwise, then there would be no interesting monads beyond IO.

A better approximation would be to say "a monad is about stringing 
together type-heterogenous things, and that stringing-together is 
associative". I say "approximation" because I'm sure enough that 
everything described in the definition above is a monad, but I'm not 
sure that the definition covers everything that is a monad.

> Monadic I/O simply recognizes this fact and provides the basic
> sequencing operation not as a language construct, as in imperative
> languages, but as /functions/, namely the monadic 'bind' (>>=) and
> 'return' functions. This is of course possible only after you
> recognize actions as (first class) values.
> 
> As to your "multiplication as "associative number combination": Sure,
> associativity does not capture the essence of what multiplication of
> numbers is. For instance, there is commutatitivity, neutral
> elements, distribution laws (referring to yet another function named
> "addition") and don't forget the interaction with ordering.

I couldn't have said that better.

> However, as soon as you take all these laws together you /can/
> precisely capture the essence of what "multiplication of numbers"
> really is.

Sure. Still, you wouldn't characterize "multiplication of numbers" as 
"associative number combination", wouldn't you?

My hypothesis is that calling Haskell's ways of doing I/O "monadic I/O" 
has the same kind of terminological mismatch, i.e. it names the concept 
after just one of several important properties.

> Compare this to I/O and "monadicity": there is nothing missing here.
> Can you name /any/ additional law (maybe involving additional
> primitive combinators) which are necessary to capture how imperative
> programms are constructed from 'I/O actions'

That depends on what aspects of I/O you want to capture in the terminology.

 > 'I/O actions' (aka 'statements')?

That's still very different things. Statements that don't involve IO can 
usually be easily mapped to purely functional code. Sometimes it may be 
helpful to apply the State monad, but even that is purely functional.

You have to step outside that and use the IO monad only if you deal with 
stateful entities that exist outside the Haskell program. Oh, and 
occasionally for debugging, but I'd like to keep *that* can of worms 
closed for the moment :-)

Regards,
Jo

4.datum->syntax-object explanation

Hello,
I'm trying to understand syntax-case transformers and I have some problem
with datum->syntax-object. Let's consider the following example:

(define-syntax lambda-foo
    (lambda (x)
      (syntax-case x ()
	((_ body ...)
	 (with-syntax ((arg (datum->syntax-object (syntax _) 'foo)))
	   (syntax (lambda (arg) body ...)))))))

this is an example of its application:

#;> ((lambda-foo (display foo) (newline)) 'test)
test
#;> 


While I intuitively understand the big picture, I still miss the syntax
point... can you please comment what's happening after the (with-syntax...
piece by piece?

In particular, what does datum->syntax-object return as 'arg'? What is the
relationship between the two 'arg'?

Thank you so much!!! :-)
Bye!

-- 
Kirk

5.Y combinator (somebody, correct this explanation)

seanf wrote:
> Hi group
> 
> I'm a Scheme newbie working through The Little Schemer.  After much
> substitution by hand, I can see how the derivation works, and how Y
> produces recursive functions in specific simple cases like length and
> factorial.
> 
> I'm still feel like I'm missing the 'aha!' experience.  I can't bridge the
> gap between making recursive functions and being a fixed-point operator. 
> Looking through old posts in this group, I found 'Programming Languages
> and Lambda Calculi' (Felleisen & Flatt) which has helped some.  Now I can
> see that, for example, that a multiplier is a fixed point of a multiplier
> maker, and (the TLS example) that length is a fixed point of the length
> maker, mk-length:
> 
> (lambda (length)
>   (lambda (l)
>     (cond
>       ((null? l) 0)
>       (else
>         (add1 (length (cdr l)))))))
> 
> But why is a fixed point of mk-length _necessarily_ length?  Are fixed
> points unique?
> 
> I'm also perplexed by a final throwaway comment in ch9 of TLS:
> 
> "What is (Y Y)   - Who knows but it works very hard."
> 
> Now I can't stop thinking about (Y Y).  I guess it's a fixed point of Y, 
> so (Y (Y Y)) is (Y Y), as is (Y (Y (Y Y))) etc.  Is there an
> important truth at the end of this, or should I just try to forget about
> it?
> 
> I only started on Scheme because I wanted to understand Lisp.  Now it
> looks like I need to learn lambda calculus to understand Scheme.  But
> before that, I'll need a good grasp of algebra, ...
> 
> 
> Sean
> 

Hi Sean,

I found from "The Why of Y by R.Gabriel" an reasonable explanation.
"Normally" your define recursive function by giving it a name

	(define FACT
		(lambda (n)...
			(if (< n 2)
				 1
				....

and use that name in function's body

				(* n (FACT (- n 1 ))))))

The name (FACT) is global variable which is "Bad" (side-effect).

If you want to create recursive function without creating new global
function name you need Y:

a)	modify your own function into lambda expression
b)	give that expression as parameter to Y -function

and you have recursion with local parameters only.
Unless I have understood it completely wrong....

What has "fixed-point" property to do with this? My guess is that
it is needed so that we can be theoretically sure that ANY function
can be given as parameter to Y.

-pekka-

6. explanation of a syntax-case example

7. Simulation behaviour, explanation requested

8. using 64-bit integers on 32-bit machine [OT: further explanation]



Return to vhdl

 

Who is online

Users browsing this forum: No registered users and 14 guest