EDA Solutions logo

Creating a DLL for T-Cells in L-Edit

Published by Jessica Masters – Latest update: 8/8/2022

Relevant product(s): L-Edit
Operating systems: Windows, Linux
Relevant area(s): Usage / Automation
ID: TN041

Summary

DLL T-Cells are types of T-Cells that can be imported from a script. These are the predominant method for PDKs to import any of their T-Cells as they can be encrypted to protect any IP data.

Using DLL T-Cells can be beneficial compared to standard T-Cells, due to being able to share the files easily, and use the cells across multiple projects.

Details

Creating a DLL T-Cell

An example, “dll_creation_example.zip”, has been provided in attachments at the bottom of this page. Please download the example to follow this technote.

Inside the example file, there is an L-Edit design called “example_project.tdb”. Open this file in L-Edit, and inside the library example_project, there are two cells. Open “Capacitor_mim” in code view by right-clicking the cell and selecting “Open Code”.

This T-cell code is generated from the L-Edit T-Cell Builder. For further details about building and editing T-cells, please see the technote here.

Inside the zip folder, there is also a file called dll_c_code.cpp. Open this file in your preferred text editor, such as VS Code.

In L-Edit, copy the text of code from: “void Cell1_main(void)” to: “/* End custom generator code.*/}”. In the provided example, these are lines 22 – 112 inclusive.

Paste this code into the dll_c_code.cpp file, between the extern and int functions. These are lines 19 – 21 in the original file.

Rename the T-Cell code to an appropriate name, for example: “mim_cap_main”. This is changed on line 20 in the example.

Inside the “extern “C” {” function, call the T-Cell by adding the command on line 17:

At the end of the code in the function “int UPI_Entry_Point(void)”, add the command shown on line 115:

Save the code file dll_c_code.cpp and re-open L-Edit. Open the cell “Test_Layout” and select the menu option Tools > Macro. Select Load and navigate to the dll_c_code.cpp file. This will load the Macro mim_cap_main. Select the Macro File and select Save as Dll.

Close the Macro window and create a new cell view. Call this cell “dll_cell” and change to the T-Cell Parameters tab. Set the Code language as DLL and click OK to create the cell.

Right-click on dll_cell and open in Code view. Type the following to call the dll code and macro:

Binary:dll_c_code.dll

Macro:mim_cap_main

Save the dll_cell and change to the Test_Layout cell view. Drag and drop the dll_cell into the layout view to place an instance.

Using multiple Macros in one DLL code

DLL code can also contain multiple Macros that can be referenced by multiple cells. The attachment, “dll_multiple_example.zip”, has been provided at the bottom of this page. Please feel free to download the example to follow this section of the technote.

The file dll_c_code_multiple.cpp shows the formatting for multiple T-Cells into a singular C file. Please open this file in your preferred text editor. This creates 3 macros: mim_cap_main, ViaM34_main, and ViaM1M2_main.

In L-Edit, open the file example_project.tdb and open the Test_Layout cell. Go to Tools > Macro, and Load in the code file dll_c_code_multiple.cpp. Select the Macro file and select Save as Dll.

Note: when the Macro file is selected, only one macro will be highlighted. This is expected behaviour and will not cause issues, as it is the macro file that will be exported into dll format, with all coded macros included.

Close the Macro window and create 3 new cells. For each of them, under the T-Cell Parameters, set the coding language as DLL and set the cell names as Via_M1_M2, Via_M3_M4, and Cap_Mim.

Open the cells in Code view and type the following:

In Via_M1_M2:

Binary:dll_c_code_multiple.dll

Macro:ViaM1M2_main

In Via_M3_M4:

Binary:dll_c_code_multiple.dll

Macro:ViaM3M4_main

In Cap_Mim:

Binary:dll_c_code_multiple.dll

Macro:mim_cap_main

Save the cells and open the cell Test_Layout. Drag and drop the other cells into the layout to place the instances. This will place the relevant devices from the DLL code.

Useful references

Using T-Cell Builder: https://www.eda-solutions.com/tn24/

Description of Compiled Macros: https://support.sw.siemens.com/en-US/product/862138555/knowledge-base/MG590725

Attachments

Example to create a DLL T-Cell: dll_creation_example.zip

Example to create multiple Macros in one DLL file: dll_multiple_example.zip