A successful ECO function call using an LLM requires careful attention to various design elements. By defining a single, unified API and simplifying arguments, the LLM can better extract and act upon ECO command parameters. This streamlined setup allows the LLM to fully utilize its coding capabilities, making the ECO process efficient and reducing errors. Additionally, providing in-context learning examples enables the LLM to generalize across similar ECO operations, achieving more accurate results.
Figure 1: ECO Function Call by LLM
GOF offers a wide range of ECO functions, but rather than training the LLM to recognize each one individually, a single API, named do_auto_change, is created to simplify decision-making and reduce ambiguity. This approach allows the LLM to bypass selecting from multiple function names and instead concentrate solely on extracting and interpreting arguments. This unified API encapsulates various ECO functions, centralizing the logic and making interaction more straightforward.
Only-one API "do_auto_change" is Defined in the Format of:
do_auto_change("action=insert_gate", "instance_pin=U1234/B", "gate_type=not", "number=15")
Here, the "action" argument defines the specific ECO operation. By structuring the API this way, the LLM focuses on interpreting arguments rather than determining which API to invoke, which reduces errors and improves processing time. Asking an LLM to focus on one task at a time often results in better, more accurate responses, whereas mixed or multi-step queries may reduce the model's effectiveness.
To allow the LLM to work effectively, it is crucial to simplify the arguments it has to parse. Complex commands, such as those in a change_pin ECO operation, require specifying details like how connections should be rerouted. By embedding intricate argument logic within the API, only essential, simplified information is passed to the LLM.
ECO change_pin and Connection Example:
change_pin('U123/A', 'NAND2X2', '', '-,net123')
In this command, "-" specifies whether the original connection attaches to pin 1 of the NAND gate. The updated unified API abstracts away this complexity:
The Function Call Generated by LLM:
do_auto_change("action=change_pin", "instance_pin=U123/A", "cell_name=NAND2X2", "connections=net123")
Now, the "connections" argument ("connections=net123") allows the internal logic to determine if a "-" is required. This way, the LLM handles simpler, standardized arguments without needing to understand specific internal routing, reducing potential mistakes.
LLMs are particularly skilled at learning from example-based training, known as in-context learning. Providing a set of basic examples helps the model generalize and handle variations in requests. With only a few examples, the LLM can infer patterns and handle more complicated cases accurately.
In-Context Learning Pair Example:
QUERY: Insert a X3 Buffer into input A pin of U1234 ANSWER: do_auto_change("action=insert_gate", "instance_pin=U1234/A", "gate_type=buf", "cell_name=X3")
Including various in-context examples allows the model to anticipate changes in parameters and respond flexibly to a range of ECO operations without requiring further intervention.
Modern LLMs are proficient in generating functional code from descriptions, making them valuable assets in ECO automation. By relying on the LLM's coding ability, complex command generation becomes faster and more accurate, reducing the time required for manual ECO script generation. Providing coding examples as a foundation further improves the quality and reliability of the code generated.
For instance, demonstrating how to use do_auto_change for different ECO actions helps the model understand the syntax and argument requirements. With these examples, the LLM can automate code generation for a wide range of ECO tasks, enhancing both productivity and code quality.
Coding Example for LLM:
QUERY: Insert a NAND 1 into stop/glue/regsame/D pin, insert a MUX 1 into B pin of the NAND, connect the MUX 1 S0 pin to net bi, and connect the MUX 1 B pin to a new inserted NAND 2 gate, the NAND 2 gate is driven by net dft_clk and pin mmux0/du0/Y, connect the MUX 1 A pin to net n_ai ANSWER: $inst_arr_nand = do_auto_change("action=insert_gate", "instance_pin=stop/glue/regsame/D", "gate_type=nand"); $inst_nand = $inst_arr_nand->[0]; print "AI_INFO! NAND gate instance $inst_nand is inserted\n"; $inst_arr_mux = do_auto_change("action=insert_gate", "instance_pin=$inst_nand/B", "gate_type=mux"); $inst_mux = $inst_arr_mux->[0]; print "AI_INFO! MUX gate instance $inst_mux is inserted\n"; do_auto_change("action=change_pin", "instance_pin=$inst_mux/S0", "connections=bi"); $inst_arr_and = do_auto_change("action=insert_gate", "instance_pin=$inst_mux/B", "gate_type=and2", "connections=dft_clk,mmux0/du0/Y"); do_auto_change("action=change_pin", "instance_pin=$inst_mux/A", "connections=n_ai");
In summary, consolidating multiple ECO functions into a single do_auto_change API enhances LLM performance by minimizing ambiguity and simplifying argument extraction. This unified approach centralizes logic, making ECO processes more efficient and reliable, allowing the LLM to focus on precise execution rather than function selection.