How can I debug Schematic File separately from my project file in Quartus? - intel-fpga

I have a Quartus II project configured to be used with Cyclone II. And I have a design I'm trying to debug using simulation facilities. It would be perfect if I could insert output pin after every symbol block in my design to see where I'm messing up, but if I do so, Quartus complains that it cannot fit the design on the device. How can I overcome this?
Is there a way to create some-kind-of-generic-project, not tied to a device, so I could test the logic?

You getting this error, when you're trying to perform full Compilation process (design compilation, timing analysis etc.). But it's not required if you simply want to simulate how your logic is going to work.
Solution:
Open Tasks Window (View > Utility Windows > Tasks).
In the Existing Flow list, you can see default flows: Compilation, Gate Level Simulation, RTL Simulation, Full Design).
Select RTL Simulation. This flow consists of only two tasks: Analysis & Elaboration and simulation.
When you perform only this two tasks, Quartus is not checking (fitter is not being used) if your logic will fit into the device.

Related

ESC/POS commands for printer module

I am trying to parse some commands to a printer module. it is extracted from a POS machine and I have driven that using Arduino as my CPU to pass image's HEX data to it. now I want to print text. I have found out that there is a universal command set called ESC/POS. but it seems like these commands are already installed on the commercial POS machines available in the market but not on the printer modules themselves. the module that I am using is this
can anyone tell me how to install ESC/POS commands for my setup? here you can see the block diagram of my setup:
As with the previous question, the search results you have shown are only the mechanical units of the printer, no control units there.
Normally, a printer has a control unit that interprets the commands received and performs printing.
If you want to connect the Arduino directly to the mechanical unit of the printer, you have to implement all the functions included in the control unit with the Arduino.
It is a system specific to the mechanical unit used, and there will be no universal and free software.
In other words, it is necessary to create all the interpretation and implementation of ESC/POS commands and the control of the mechanical unit by scratch.
If that is what you want to do, do your best.
Here's an article that does something similar to you. It doesn't seem to be resolved.
Print problem
This article includes the data sheet of the mechanical unit used by the questioner.
LTPZ245-B_J.pdf
If you really want to use this topology, this datasheet will be useful.
SII Thermal Printer Product Catalog 2018-2019
Usually, use the control board(IFD501-01UK/IFD501-01SK) as shown on page 5 of this catalog.
If this is the case, contact SII and we will provide you with a printer driver for Linux.
I don't know if it can be used with Arduino.
Or, even without a device driver, a serial port control board(IFD501-01SK) would make it easy to connect and communicate with the Arduino.

Can I make a terminal program in C to edit photos in GIMP [macOS]?

I am editing a large batch of photos using the same steps, and want to create a program to run through terminal that will run the process for me. I am comfortable with writing in C, but I am unsure of how to start on the code/what commands to use.
When I am in GIMP, I start by opening a .xcf file, and importing the photo I wish to edit in as the bottom layer. Next, I resize the layer to 1000px wide. After that, I edit the curves with a preset I have saved, and then do the same with the brightness controls. Finally, I export the file as a .png with a specific name: 01-0xx.png, based on the number of the photo in the set.
This sounds like a job for macros or the automation tools available in Gimp:
Ref: Gimp Automate Editing https://www.gimp.org/tutorials/Automate_Editing_in_GIMP/
This tutorial will describe and provide examples for two types of
automation functions. The first function is a tool to capture and
execute “Macro” commands. The second function is a set of Automation
Tools to capture and run a “Flow” or “Process”. The code for this
tutorial is written using Gimp-Python and should be platform portable
– able to run on either Linux or Windows operating systems. *
The goal of these functions is to provide tools that speed up the
editing process, make the editing process more repeatable, and reduce
the amount of button pushing the user has to do. Taking over the
button pushing and book-keeping chores allows the user to focus on the
more creative part of the editing process.
I haven't ever used GIMP, but programs of this sort typically have automation scripting support, and this is the right place to start.
Could be done with C, but the learning curve is steep.
You can write Gimp scripts in Scheme (Lisp) or Python, and if you know C you can learn enough Python in a couple of hours. See an example of a Python batch script here.
Side note #1: Curves+Brightness contrast can be done in one single call to Curves (with a different curve of course). Each operation entails some color loss, so the fewer, the better.
Side note #2: It may be simpler to do this with without Gimp using:
The ImageMagick tool box (command called from a shell script)
An image library with any language ("pillow" for python).
Your Curves preset is just what is called a "CLUT" (Color Look-Up Table).

RED Robot Editor - Is there anyway to execute multiple testsuites parallelly?

I have 7 testsuites that are specific to languages something like German, Finish, Italy etc., I would like to execute all at one time. Kindly provide me solution on this. Referred to many materials, but having confusions that how we should work with RED Editor.
AFAIK the only possibility to add parallel execution to robot tests is to
parallelize code inside python classes or
make each test suite a
separate test call (i.e. with ctest execution) and call several of
them separately (ctest -j)
RIDE does not provide this, nor does robotframework natively.
In the recent releases of RED it is possible to use a custom script to launch robot from RED. The documentation shows some examples in the Launch Scripting section. In the section about launching using Gradle there is a nice Windows batch example.
This could be used to have RED launch Pabot to run several Robot sessions in parallel. This would allow you to achieve the parallelisation from RED you seek.
The Selenium Grid can help with this, but I'd consider it if the testing load needs to be spread across multiple machines. If only running locally, then pabot itself is sufficient.

Improve WPF Application Coldstart: Suggestions to run program when machine starts up

Is it possible to load your WPF application when the machine starts up? Our WPF application is taking 30 seconds on our existing client hardware, and we'd like to "hide" that by having our application startup when the machine is booted. But the fact that our application boots on startup should be invisible to the user.
How would we go about building such a thing? Is there a term to google that will provide a tutorial? It would be nice if there's a WPF specific-one we can grab.
Note: In case there's any moral qualms to this (since I agree that having 20 programs startup when your computer does is frustrating!), we're building software for a specialized industry who will be using their computer to run primarily our applications.
The easiest approach would be
make sure your big libraries are installed in the GAC
write a dummy app that uses (most of) those libs. Actually use them so they get loaded.
run the dummy on startup
make the dummy stop by itself, or keep it alive hidden
This would in no way interfere with the starting of the normal application. The benefit is that the libraries get loaded and jitted. The drawback that your app still needs to load & initialize.
Sasha had a few more tips not listed here, rebasing your modules, leveraging the prefetch facility and compression (UPX, yuk!).

What makes WPF application startup slow?

I noticed that WPF application startup is sometimes pretty slow. Does anybody know if the the cause is the elements initialization or DLLs loading or something else?
The text below was extracted from this MSDN article on Improving WPF applications startup time (Edit: now merged into WPF Application Startup Time)
Application Startup Time
The amount of time that is required for a WPF application to start can vary greatly. This topic describes various techniques for reducing the perceived and actual startup time for a Windows Presentation Foundation (WPF) application.
Understanding Cold Startup and WarmStartup
Cold startup occurs when your application starts for the first time after a system reboot, or when you start your application, close it, and then start it again after a long period of time. When an application starts, if the required pages (code, static data, registry, etc) are not present in the Windows memory manager's standby list, page faults occur. Disk access is required to bring the pages into memory.
Warm startup occurs when most of the pages for the main common language runtime (CLR) components are already loaded in memory, which saves expensive disk access time. That is why a managed application starts faster when it runs a second time.
Implement a Splash Screen
In cases where there is a significant, unavoidable delay between starting an application and displaying the first UI, optimize the perceived startup time by using a splash screen. This approach displays an image almost immediately after the user starts the application. When the application is ready to display its first UI, the splash screen fades. Starting in the .NET Framework 3.5 SP1, you can use the SplashScreen class to implement a splash screen. For more information, see How to: Add a Splash Screen to a WPF Application.
You can also implement your own splash screen by using native Win32 graphics. Display your implementation before the Run method is called.
Analyze the Startup Code
Determine the reason for a slow cold startup. Disk I/O may be responsible, but this is not always the case. In general, you should minimize the use of external resources, such as network, Web services, or disk.
Before you test, verify that no other running applications or services use managed code or WPF code.
Start your WPF application immediately after a reboot, and determine how long it takes to display. If all subsequent launches of your application (warm startup) are much faster, your cold startup issue is most likely caused by I/O.
If your application's cold startup issue is not related to I/O, it is likely that your application performs some lengthy initialization or computation, waits for some event to complete, or requires a lot of JIT compilation at startup. The following sections describe some of these situations in more detail.
Optimize Module Loading
Use tools such as Process Explorer (Procexp.exe) and Tlist.exe to determine which modules your application loads. The command Tlist <pid> shows all the modules that are loaded by a process.
For example, if you are not connecting to the Web and you see that System.Web.dll is loaded, then there is a module in your application that references this assembly. Check to make sure that the reference is necessary.
If your application has multiple modules, merge them into a single module. This approach requires less CLR assembly-loading overhead. Fewer assemblies also mean that the CLR maintains less state.
Defer Initialization Operations
Consider postponing initialization code until after the main application window is rendered.
Be aware that initialization may be performed inside a class constructor, and if the initialization code references other classes, it can cause a cascading effect in which many class constructors are executed.
Avoid Application Configuration
Consider avoiding application configuration. For example, if an application has simple configuration requirements and has strict startup time goals, registry entries or a simple INI file may be a faster startup alternative.
Utilize the GAC
If an assembly is not installed in the Global Assembly Cache (GAC), there are delays caused by hash verification of strong-named assemblies and by Ngen image validation if a native image for that assembly is available on the computer. Strong-name verification is skipped for all assemblies installed in the GAC. For more information, see Gacutil.exe (Global Assembly Cache Tool).
Use Ngen.exe
Consider using the Native Image Generator (Ngen.exe) on your application. Using Ngen.exe means trading CPU consumption for more disk access because the native image generated by Ngen.exe is likely to be larger than the MSIL image.
To improve the warm startup time, you should always use Ngen.exe on your application, because this avoids the CPU cost of JIT compilation of the application code.
In some cold startup scenarios, using Ngen.exe can also be helpful. This is because the JIT compiler (mscorjit.dll) does not have to be loaded.
Having both Ngen and JIT modules can have the worst effect. This is because mscorjit.dll must be loaded, and when the JIT compiler works on your code, many pages in the Ngen images must be accessed when the JIT compiler reads the assemblies' metadata.
Ngen and ClickOnce
The way you plan to deploy your application can also make a difference in load time. ClickOnce application deployment does not support Ngen. If you decide to use Ngen.exe for your application, you will have to use another deployment mechanism, such as Windows Installer.
For more information, see Ngen.exe (Native Image Generator).
Rebasing and DLL Address Collisions
If you use Ngen.exe, be aware that rebasing can occur when the native images are loaded in memory. If a DLL is not loaded at its preferred base address because that address range is already allocated, the Windows loader will load it at another address, which can be a time-consuming operation.
You can use the Virtual Address Dump (Vadump.exe) tool to check if there are modules in which all the pages are private. If this is the case, the module may have been rebased to a different address. Therefore, its pages cannot be shared.
For more information about how to set the base address, see Ngen.exe (Native Image Generator).
Optimize Authenticode
Authenticode verification adds to the startup time. Authenticode-signed assemblies have to be verified with the certification authority (CA). This verification can be time consuming, because it can require connecting to the network several times to download current certificate revocation lists. It also makes sure that there is a full chain of valid certificates on the path to a trusted root. This can translate to several seconds of delay while the assembly is being loaded.
Consider installing the CA certificate on the client computer, or avoid using Authenticode when it is possible. If you know that your application does not need the publisher evidence, you do not have to pay the cost of signature verification.
Starting in .NET Framework 3.5, there is a configuration option that allows the Authenticode verification to be bypassed. To do this, add the following setting to the app.exe.config file:
<configuration>
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>
</configuration>
Compare Performance on Windows Vista
The memory manager in Windows Vista has a technology called SuperFetch. SuperFetch analyzes memory usage patterns over time to determine the optimal memory content for a specific user. It works continuously to maintain that content at all times.
This approach differs from the pre-fetch technique used in Windows XP, which preloads data into memory without analyzing usage patterns. Over time, if the user uses your WPF application frequently on Windows Vista, the cold startup time of your application may improve.
Use AppDomains Efficiently
If possible, load assemblies into a domain-neutral code area to make sure that the native image, if one exists, is used in all AppDomains created in the application.
For the best performance, enforce efficient cross-domain communication by reducing cross-domain calls. When possible, use calls without arguments or with primitive type arguments.
Use the NeutralResourcesLanguage Attribute
Use the NeutralResourcesLanguageAttribute to specify the neutral culture for the ResourceManager. This approach avoids unsuccessful assembly lookups.
Use the BinaryFormatter Class for Serialization
If you must use serialization, use the BinaryFormatter class instead of the XmlSerializer class. The BinaryFormatter class is implemented in the Base Class Library (BCL) in the mscorlib.dll assembly. The XmlSerializer is implemented in the System.Xml.dll assembly, which might be an additional DLL to load.
If you must use the XmlSerializer class, you can achieve better performance if you pre-generate the serialization assembly.
Configure ClickOnce to Check for Updates After Startup
If your application uses ClickOnce, avoid network access on startup by configuring ClickOnce to check the deployment site for updates after the application starts.
If you use the XAML browser application (XBAP) model, keep in mind that ClickOnce checks the deployment site for updates even if the XBAP is already in the ClickOnce cache. For more information, see ClickOnce Security and Deployment.
Configure the PresentationFontCache Service to Start Automatically
The first WPF application to run after a reboot is the PresentationFontCache service. The service caches the system fonts, improves font access, and improves overall performance. There is an overhead in starting the service, and in some controlled environments, consider configuring the service to start automatically when the system reboots.
Set Data Binding Programmatically
Instead of using XAML to set the DataContext declaratively for the main window, consider setting it programmatically in the OnActivated method.
The most useful advice on fixing WPF startup performance I've ever seen was given in this other question: run "ngen update" in every framework folder.
It seems that Microsoft can't keep their ngen cache up-to-date, which results in your application pretty much recompiling half the .NET framework every single startup.
Hard to believe, but seems to be true.
The startup time of a WPF Application can be much faster if you use Framework 3.51 and not 3.5 or 3.0. The 3.51 is really an improvement.
This is an old thread, but I've ended up here several times while trying to fix a startup performance issue with WPF apps on my Win10 system, so I thought I'd state an answer which may help others - an answer that takes a horrible 5 second startup time for all WPF apps on this system down to just a few milliseconds. Remove the nVidia "3d Vision" driver. I have a GeForce GTX 650 card, and the "3d Vision" driver doesn't seem to offer anything useful, so removing it is no problem for me. The VisualStudio2015 performance analysis tool finally helped show that almost all the 5 second startup time was spent IDLE after a call through nvapi64.dll - the nVidia driver. Wow.
What helped me the most from the excellent article that Stuart links to was the XmlSerializer trick. That really shaved up quite a few seconds. Furthermore don't underestimate defragmenting your HD :-)

Resources