Practice English Speaking&Listening with: Introduction to C++ Code Generation from SystemVue Schematic

Normal
(0)
Difficulty: 0

Welcome to the discovering Agilent SystemVue video series. This tutorial will familiarize

you with the basic operation of the SystemVue C++ Code Generator that is new to the SystemVue

2010 release. This video will highlight features of the W1461 SystemVue communications architect

based product, as well as the W1718 C++ Code Generator.

SystemVue 2010 now supports C++ code generation for creation of floating point C++ models

and compiled Window 32 DLLs from SystemVue schematic models. These schematic models support

any user defined custom model built using SystemVues C++ model builder interface.

These models can also be built from commonly used DSP and signal processing blocks that

are available as standard features within SystemVue. The C++ Code Generator supports

both licensed and unlicensed model generation.

Built-in models that support C++ code generation are contained within the algorithm development

library under C++ code generation models. These models include basic blocks like adders,

gain blocks, and subtractors, as well as higher level communication signal process functions

like OFDM modulators, demodulators, coders and encoders, etcetera.

To explore the functionality of the SystemVue C++ Code Generator, we will look at a simple

design of a cascade integer comb, or CIC filter, that weve created in SystemVue. Here you

can see Ive already created the schematic for a two stage CIC filter that implements

a lowpass response. By simulating this filter we can take a look at the lowpass response,

just to validate that the design is indeed working as expected. To start the C Code Generator

process I can simply just export each one of these models individually, or I can gather

up these models and convert these models into a subnetwork by selecting the models, right

mouse clicking, and selecting convert to subnetwork. Here I could type in a custom name for the

new subnetwork model that will be added to my workspace. Ive already precreated that

model and I will just open it up and you can see that it shares the same architecture as

the CIC filter that it was created from.

To validate my subnetwork model Ive created a new design to simply dif the output of the

new subnetwork CIC filter model from the original top level model and output that result into

a display. So if I just hit the simulate, go to my workspace tree, open up the new graph,

we can see that the output is in fact zero, which means the new subnetwork model is exactly

the same as the original design.

I can now use that same top level design for validating my subnetwork to target the new

subnetwork to C++ Code Generator. To do so I go to my workspace tree and I need to add

a C++ Code Generator controller to my workspace. To do so simply right mouse click, select

add C Code Generator and add C++ Code Generator. The C++ Code Generator UI allows me to select

the top level design for which I want to export models for C++ cogeneration, as well as select

individual models that I want to export. Ive already added the subnetwork model that we

created in the last step, and if I wanted to add additional models I could simply do

so by selecting the add button and selecting the appropriate models that I want to export.

I also need to select the proper shell type. In this case Im going to select a SystemVue

model shell type to generate a compiled DLL that can be used as a standalone and portable

library within the SystemVue environment.

Once all the correct parameters are specified within the C Code Generator UI, generation

of all the required source code files can simply be done by selecting the generate now

button. SystemVue will simulate and generate all of the required source code files to the

file system of your PC.

Based on the directory setting within the C Code Generator UI, SystemVue generated a

new folder called codegen_CICfilter where it has also created a SystemVue folder which

represents the shell type that we selected. And within the SystemVue folder you can see

the C++ header file, XML file, and other Microsoft Visual Studio project files that were created

automatically by the C Code Generator process. Also within the C Code Generator folder there

is a Microsoft Visual Studio solution file that was created by the C Code Generator which

contains the full Microsoft Visual Studio solution where we can build our DLL.

To build the SystemVue dynamically linked library, we simply need to open the Microsoft

Visual Studio solution and within Microsoft Visual Studio we simply select the SystemVue

project, that again was automatically created by the SystemVue Code Generator project, and

right mouse click and select build. And here you can see in the status window that Microsoft

Visual Studio is compiling and generating the dynamically linked library from the SystemVue

generated code. Also within Microsoft Visual Studio, should you want to modify the C source

code, if you own the W1718 product from SystemVue you can actually see the C++ code and modify

and add any additional C++ code that you would like to this file.

Now that weve created the dynamically linked library from Microsoft Visual Studio, we need

to link it to SystemVue by going to the library manager, which is accessible from the tools

menu within SystemVue, selecting add from file and then selecting the DLL that was created

by Microsoft Visual Studio. Now, note that that DLL was contained in a new folder created

by Microsoft Visual Studio under the original C code CIC filter generation folder that SystemVue

created during the C code generation process. Within the debug SystemVue folder I can see

the DLL, select open, click close, and now that DLL is associated with SystemVue.

To access the new library that was linked in through the SystemVue library manager,

I could either use the SystemVue parts selector to select the C Code Generator library, which

is now enabled by linking that DLL, and selecting the part or parts that are in that library

by selecting it from the parts selector and dropping it within my schematic. Or I can

simply associate the new model to my subnetwork model by double clicking the subnetwork model,

selecting manage models, add model, model from library, and then selecting the library

that was created, again by linking the DLL from Microsoft Visual Studio, and I could

associate this new model to my subnetwork model. I now have two different models that

I could select, both the original subnetwork model and the new compiled C code model from

the dynamically linked library.

So Im just going to select the new dynamically linked compiled C model, and I will rerun

the simulation and we will view the same result that is showing the difference between the

original top level model and the new compiled model. And again, as you can see, that result

is zero, which means the new compiled model does indeed match exactly the original subnetwork

model that generated the C code.

So, to summarize, in this video we covered the basics of using the C++ Code Generator

within the SystemVue 2010 product. We demonstrated how the C Code Generator can be used to build

model libraries that are both portable and protected for use within SystemVue or other

third-party tools. We quickly built a reusable SystemVue library that can be deployed within

a work group or within your customer base. We also demonstrated how Microsoft Visual

Studio is integrated within the C++ code generation process to build dynamically linked libraries

that can be used by SystemVue or by other third-party products.

For more information on Agilent SystemVue, please visit www.Agilent.com/find/SystemVue.

From this link you can learn more about SystemVue product and SystemVue features, as well as

request an online evaluation license for the SystemVue product and the C Code Generator.

Thank you very much.

The Description of Introduction to C++ Code Generation from SystemVue Schematic