The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 3:46pm
Pages: 1
Send Topic Print
entity/architecture (Read 5051 times)
aldavis
New Member
*
Offline



Posts: 4
Flint, Michigan
entity/architecture
Mar 27th, 2007, 10:57pm
 
I am trying to figure out a way to do the entity/architecture concept that VHDL has.

I can see a way based on naming conventions or the preprocessor, but I really prefer something officially supported by the language.

It is for a multi-tool suite, not all simulation.  There are several architectures per entity,  The intent is to have a mechanism for automatically choosing architectures.  How to choose is not the problem.  There are cases where more than one architecture can be used at the same time, may be selected by a "binning" mechanism, or may be dynamically chosen during a simulation, or by a non-simulation application.

VHDL has the needed features, language defined.  We would rather use Verilog, but need this feature.
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: entity/architecture
Reply #1 - Mar 28th, 2007, 5:08am
 
I'm not fully versant on entity/architecture, but the idea of automatically selecting something along the lines of "binning" of MOS models is supported by Verilog-AMS's paramset.  Two notes: 1) I'm not sure simulator has yet implemented paramsets and 2) it can't be chosen during a simulation, the choice is made at elaboration time, so maybe this can't fully satisfy your request.

In VHDL, I guess the entity fixes the ports and parameters.  Can the architecture define new internal nodes, such that the circuit matrix would change?
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
aldavis
New Member
*
Offline



Posts: 4
Flint, Michigan
Re: entity/architecture
Reply #2 - Mar 28th, 2007, 8:14pm
 
The pressing need is for a multi-tool environment, with about 10 tools interacting.  Only 2 of them are simulators.

VHDL has the concept of an "entity" which has one or more "architectures".  In verilog, these concepts are combined into a "module".  The "entity" specifies the interface, much like a function prototype in C.  The "architecture" implements it.  The body of an "architecture" is equivalent to the body of a "module".

The important feature is that there can be several "architectures" and a language supported way to specify it.

In simulation, one use of separate architectures might be a structural and behavioral model of the same entity, or possibly a fast model and an accurate model, or a nice model that guarantees convergence, used to start a homotopy to an accurate model that might not be so well behaved.

entity FOOBAR is
....
end entity

architecture yellow of FOOBAR is
....
end architecture

architecture green of FOOBAR is
....

architecture red of FOOBAR is
....

architecture blue of FOOBAR is
....

I can refer to FOOBAR, and have which one automatically selected somehow, or I can refer to FOOBAR(blue) or something like that.

I suppose it could be done in Verilog with the preprocessor:

`ifdef yellow
module FOOBAR
....
`else
`ifdef green
module FOOBAR
....

...
`endif
`endif

but we want to be able to select more than one, perhaps to compare one to another.

Another approach could be multiple modules with a naming convention

module FOOBAR_yellow
....

module FOOBAR_green
....

.. and we could have a "proprietary" way to map and select.

But we don't want proprietary.  We want to support industry standards, and make the best use of them.  We have existing tools in Verilog and would like to stick with it.  Our user community has indicated a strong preference for Verilog over VHDL.

So ..

Is there an official language specified way to do this?  (I can't find it.)

Is there a precedent for naming conventions or something like that?

Is there a better way?
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: entity/architecture
Reply #3 - Mar 29th, 2007, 5:14am
 
The paramset definition isn't clear on whether the paramsets can refer to different underlying modules.  Eg, could one have

paramset nmos behav_model;
 parameter integer selector = 0 from [0:1);
...

paramset nmos detailed_model;
 parameter integer selector = 1 from (0:1];
...


Then you could instantiate both
nmos #(.selector(0)) M1(.d(d), .g(g), .s(0), .b(0))
nmos #(.selector(2)) M2(.d(d), .g(g), .s(0), .b(0))


The original idea for paramsets was that the underlying module would be the same, which would allow for the usual automatic model selection based on L and W for MOS devices.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: entity/architecture
Reply #4 - Mar 29th, 2007, 5:16am
 
Actually, probably a better/more standard way is to use the "generate" construct.  This is covered in 12.4.2 Conditional generate constructs in the 1364-2005 LRM.  There's actually an example that instantiates an OR or an AND depending on parameter values.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
aldavis
New Member
*
Offline



Posts: 4
Flint, Michigan
Re: entity/architecture
Reply #5 - Mar 30th, 2007, 1:03am
 
Generate doesn't do it but thanks for pointing it out.

Paramset, used as you propose, might be good enough.  It gives me some ideas.  It looks like a refinement of the naming convention method I mentioned.

Having it able to refer to different underlying modules is good, should be required, to a point, but I see potential for abuse.  

Something like the mosfet levels in Spice make sense.  In a way, the levels are different architectures of the same entity.

What bothers me is having no consistency requirement at all.  One could be a resistor, another a mosfet.  That's clearly abuse.  On the other hand, one is BSIM4, the other is a switch or voltage controlled resistor are close enough to make sense.  With the correct simulator design, you could use the detailed model (BSIM4) in "spice" mode, or the switch in "fast" mode.  Using the switch enables certain optimizations so it runs much faster.  I know of at least one simulator that actually does this.
Back to top
 
 
View Profile   IP Logged
jbdavid
Community Fellow
*****
Offline



Posts: 378
Silicon Valley
Re: entity/architecture
Reply #6 - Apr 4th, 2007, 2:15am
 
I'm not sure if the idea of a "configuration"  which I use all the time with spectre & AMS  helps..
with-in the tool you can have multiple views of an object.. (ie a schematic or veriloga model or verilogams model or functional model.. depending on the tool you are using, the views its compatible with, and the search order you list, some views are used by default - the configuration allows you to specify the view you want for the cases where the view is not the default..
generally I leave the schematic as the default, then set the config to use the veriloga view..  where I want that to be used..
--
If there is an elaboration step defined in verilog ams, the configuration is the information  used by the elaborator to choose the view to use when more than 1 view type exists.. but this might be specific to the Cadence implementation..

Altermatively - one might use a "view binding" property on an instance declaration..
(* string view_binding = "analogfunctional"; *)

each view of the same block would have the same module name, but a different view name (can be id'd by the file extension..
.va = veriloga .vaf = analogfunctional .vb = behavioral .vab = analogbehavioral .vs = structuralnetlist (ie from synthesis)
.vas = analogschematic  etc..

this sort of assumes the cadence NC compilation  model  where each file/module (and each view of that module) is compiled as its own object in the binary library, and then the linker(elaborator) determines which object to use.. as directed by the configuration (sort of a make file?)

-- but the basic idea in verilog is to let something outside the module  itself control which flavor of instances are used during the simulation.

so the module defined the interconnection of the blocks of your design, while the configuration determines which models (views ) of those blocks are going to be used..

the cadence model makes library.cell:view as a directory structure in the filesystem..
for a "flat" file structure the extension is used as a view identifier..
(note this works with Nedit as a text editor as well as the syntax patterns depend on the file extension.. )

If I keep going I'm rambling (if I'm not already..)
jbd
Back to top
 
 

jbdavid
Mixed Signal Design Verification
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.