Lab 1 AI Prototype

Write Me HDL

Learning Goals

The goal of this prototype is to experiment with using AI as a coding assistant to generate HDL. By the end of this experiment you should be able to:

  • Demonstrate how an LLM can be used as a coding partner.
  • Analyze the quality of the LLM-generated code.
  • Document specific tips on how to use the LLM effectively.

Prototype

Fire up your favorite LLM. ChatGPT is a good place to start, but you may consider using other LLMs as well like Claude or Gemini. Enter the prompt below.

LLM Prompt

Write SystemVerilog HDL to leverage the internal high speed oscillator in the Lattice UP5K FPGA and blink an LED at 2 Hz. Take full advantage of SystemVerilog syntax, for example, using logic instead of wire and reg.

Create a new Radiant project, type the code generated by the LLM in and analyze the results. If the synthesis fails, type the error message back into the LLM to see what suggestions it generates.

Reflect

Write up a few paragraphs reflecting on your experience using the LLM to help you code. Feel free to make full use of screenshots, code snippets, and other media as you write your reflections.

Here are a few ideas of on what you might comment on:

  • How would you rate the quality of the output and why?
  • What SystemVerilog constructs/syntax did the LLM generated that were new to you?
  • Did the LLM-generated code synthesize the first time around? If not, what were the issues?
  • What error or warning messages did Radiant output?
  • What would you do differently the next time you use an LLM in your workflow?