Yosys : Is it possible to generate " Gate-level constraints file" using Yosys. That is like sdc file generated by Synopsys RTL compiler - asic

Yosys: I am new to Yosys. But I am familiar with the RTL compiler. I am able synthesis modules using yosys. Is it possible to generate " Gate-level constraints file" using Yosys. That is like sdc file generated by Synopsys RTL compiler.

Related

How to add multiple language support in Delphi XE2 application

I'm a beginner in Delphi but I need to add multiple other languages support to current application.
Projects->Languages->Add(languages) does not work in my version of Delphi and gives these errors on compiling:
[Error] E1026 File not found: 'vcl\DBLOGDLG.dfm'
[Error] E1026 File not found: 'vcl\DBPWDLG.dfm'
I tried creating my own translation by adding them to [root]/lang/ en.rc , lt.rc, lv.rc
Example of lang.rc
STRINGTABLE
BEGIN
telefon_monitor L"Phone Monitoring"
koned L"Calls"
alates L"From"
kuni L"Until"
vali_numbrid L"Choose numbers"
otsi L"Search"
tolgi L"Translate"
satted L"Settings"
salvesta L"Save"
lisa_rida L"Add row"
END
I have no idea how to read them.
Does anyone have any better idea how to load translations?
What I want to do is, read config.ini [language] section and based that display translation from .rc file or some better extensions.
Could not use github.com/albertodev01/TLanguages on Delphi XE2 which sucks.
I ended up creating a translation.json file and overwrite default values on Application.FormCreate plus made language toggle system
{ "en_EN":{ "hello":"Hello!" },
"lv_LT":{ "hello":"Hi!" }
}
PS! Parsing nested json in older Delphi is something else.

Weird hidden characters in exported XLIFF file

Whenever I try to 'Export For Internationalization', the exported file contains a weird hidden character, making it unparsable for XLIFF editors. The problem seemed to be in the original .string files, somehow the weird character was inserted in those files. I have since deleted the weird character but whenever I export it still sneaks into the xliff file. I tried cleaning and rebuilding the project, restarting Xcode... none of that seems to work.
Is Xcode somehow using a cached version of the 'bad' .strings file containing the bad character?
Using Xcode
If I try Editor > Export For Localization
I get:
/usr/bin/xmllint exited with status 1
Using Terminal
When I run it from Terminal like so:
xcodebuild -exportLocalizations -localizationPath
/Users/Kymer/Downloads/Wolf -project Wolf.xcodeproj -exportLanguage fr
I get the following errors:
parser error : attributes construct error
parser error : Couldn't find end of Start Tag trans-unit
parser error : PCDATA invalid Char value 19
parser error : PCDATA invalid Char value 19
parser error : Opening and ending tag mismatch
parser error : invalid character in attribute value
parser error : attributes construct error
parser error : Couldn't find end of Start Tag
parser error : PCDATA invalid Char value
/Uxcodebuild: error: /usr/bin/xmllint exited with status 1
In both cases the exported xliff file contains the weird hidden character upon inspection with Sublime Text:
If I manually remove the bad characters the file is perfectly readable by xliff-editors but that's not a good long-term solution of course.
I found the problem: when exporting to an XLIFF file Xcode doesn't look at your .string files, it is all generated from the project itself (i.e. it looks at all NSLocalizedString calls and your storyboards). Which makes sense. I found the weird hidden character in one of my code files. Removing it from the source file fixed the export issue.
Easiest XLIFF workflow
I'll also mention this for future reference: the easiest way to add a new language to your project is to first use the command line:
cd to the your project and run:
xcodebuild -exportLocalizations -localizationPath <path> -project <projectname>.xcodeproj -exportLanguage <language code>
That creates a new XLIFF file and will correctly set the target language in the file (source language will be your base language). A translator can now easily add all necessary translations. Afterwards you can import the translated XLIFF file back into Xcode (select target and Editor > Import localizations). Xcode will then generate all necessary .string files.
Updating existing language: If you add new UI elements and want to update an existing localization language, you can simply export an existing localization (select target and Editor > Export for localization). That XLIFF file will contain all previous translations together with the new strings. A translator simply has to fill in the 'blank' lines. There's no need to touch the .string files yourself, because managing that manually is a pain (especially with the crazy Storyboard ID's).

Auto rename compiled file in Delphi XE2

I use Delphi XE2 and I have a project called PGetBase. In this project, there is a module with a constant declaration. For example:
const
   FragH = 5;
   FragW = 4;
...
After compiling, the file is called PGetBase.exe. Is it possible to make the name of the build file dependent on the constants declared in the module, e.g. PGetBase_5_4.exe, by making use of a Post-Build event?
Add a project to the projectgroup which creates an executable that uses the same unit and changes the filename. Build and run that executable in the Post-Build event.
Microsoft Build knows nothing about the Pascal language and cannot parse the sources.
However you may extract "5" and "4" into some external text files.
const
FragH =
{$I Frag_h.txt}
;
FragW =
{$I Frag_W.txt}
;
Then make a simple program (or script: WSH, PowerShell, etc), that would be launched from post-build events.
You program would read those file and rename the Delphi-made PGetBase.exe to anything you wish.
PS. Of course one can parse the source unit to regain those constants, rather than offloading them into external storage. Comments hold the discussion pro et con.
PPS. NGLN came wit ha neat idea. Rather than parsing the file, you can just include that unit as part of your renamer project. Then you can add a pre-build event, that would compile(make) renamer and in post-buid the renamer would have those constants within itself. While calling make/dcc32 would probably be slower than just parsing the sources from inside the version-neutral pre-compiled renamer.exe, that NGLN's approach is elegant and self-contained in its own way.

Delphi .res file changer

I'm looking for a ready-to-use piece of code that would be able to read and modify Delphi .res files. The thing is that I need to create an application that will be compiling many Delphi projects at once (using the dcc32.exe file). However, it is necessary for me to change file version and language before compilation, and as far as I know, I have to modify the .res file to do that.
Have you come across any code that would give me an interface to .res files allowing me to modify the data contained in it? The thing is that I want to change only those two pieces of information keeping the rest unchanged. This is why I can't compile my own .res file based on a script.
An application executed from a command line would also be OK if it allows to be called with parameters and does what I need it to do.
Thank you very in advance!
If all you need is to add file version resource then create appver.rc file, compile it with brcc32 and in one of your app unit (for example appver.pas) add {$R appver.res} (as Marian noticed you must turn off Delphi project option to include version info).
I created command line programs that increase build numbers in .rc file, create new branch/tag in SVN with new version in branch name, compiles .rc to .res, and build application.
My .rc files with such info (Polish language) looks like:
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO LOADONCALL MOVEABLE DISCARDABLE IMPURE
FILEVERSION 7,28,7,17
PRODUCTVERSION 7,28,7,17
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0
{
BLOCK "StringFileInfo"
{
BLOCK "041504E2"
{
VALUE "CompanyName", "xxx\0"
VALUE "FileDescription", "yyy\0"
VALUE "ProductName", "zzz\0"
VALUE "FileVersion", "7.28.7.17\0"
VALUE "ProductVersion", "7.28.7.17\0"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0415, 1250
}
}
For all things .res, look at Colin Wilson's "XN Resource Editor", for which he provides the source code: http://www.wilsonc.demon.co.uk/d10resourceeditor.htm
And probably all you need is his resource utility library:
http://www.wilsonc.demon.co.uk/d9resourceutils.htm
I haven't used this source, but if I needed it, that's the first place I'd look. His resource editor is very useful, btw.
There is ChangeRes which seems to match your needs.
Check out sources:
http://code.google.com/p/gedemin/source/browse/trunk#trunk/Gedemin/Utility/IncVerRC
It is our utility which reads .RC file with version information and increments build number. We use it inside our build process. Here is an excerpt:
incverrc.exe ..\gedemin\gedemin.rc
"%delphi_path%\brcc32.exe" -fogedemin.res -i..\images gedemin.rc
"%delphi_path%\dcc32.exe" -b gedemin.dpr
The utility uses TIncVerRc class written by Chris Morris.
Check Resource Tuner Console on www.heaventools.com. They position that product for tasks like yours. Also there's a free rcstamp tool on CodeProject.

How do I import an ActiveX control in BCB5 with tlibimp?

What are the required flags for tlibimp.exe to properly mimic choosing
'Component -> Import ActiveX Control -> Install'
in the Borland C++ Builder 5 IDE? I currently pass tlibimp an ocx and -L-, but there is a loss in funcionality when compared with results of importing it manually.
The command line depends on what the IDE is attempting..for example install a component as active x.
-A TypeLibrary file suffix (defaults to '_TLB', -A- : no
suffix)
-D Output directory
-F TypeLibrary Output filename (extension ignored)
-N C++ namespace name
-X OCX Wrappers Output filename (extension ignored - C++
only)
Switches: - (defaults are shown below)
-C- Generate C++ import file
-E+ Generate wrapper class for dispinterfaces (C++ only)
-G+ Expose namespace with 'using' statement
-H+ Generate IDE component wrappers for ActiveX Controls
-J- Generate CORBA IDL source file
-K- Generate Pascal CORBA Stubs and Skeletons
-L- Generate IDE component wrappers for OLE Servers
-O+ Generate CoClass Creator wrappers
-P+ Generate Pascal import file
-Q+ Generate 'Register' function for IDE components wrappers
-R+ Generate files for dependent typelibraries
-S+ Map HRESULT stdcall to safecall on dual interfaces (Delphi only)
-T- Map HRESULT stdcall to safecall on all interfaces (Delphi only)
-V- Generate Event wrappers for Server (C++ only)
-W+ Warnings in import file
-Yh Ignore the [Hidden] flag when importing
-Yr Ignore the [Restricted] flag when importing
-Yp Ignore the [PreDeclID] flag when importing
-Ya Combined -Yh -Yr -Yp
--
Michael
It turns out that functionality loss was due to the fact that the ocx file I was importing was not registered. The projects that used this activeX control still compiled without a problem, but were still flawed.
Registering the ocx with regsvr32 solved the problem.

Resources