|
|
Verilog Programming
The Verilog programming contest is now open! Upload your submissions here! Deadline is March 7, 2010.
Are you the kind who always wanted to design digital circuits, but found the breadboard approach frustrating and time consuming? Ever wondered how ICs were designed starting from their specification but without going as far down as the transistor level? In short, we are talking of Computer Aided Design or the exciting area of Hardware description languages, where programming languages take on a whole different meaning: they describe functional pieces of hardware and not a sequence of executable instructions.
Rules
Submission Guidelines
Problems
Problems 0 to 5 all carry weightage in increasing order of difficulty. Problem 0
This is more like Verilog Warm Up.
Problem 1
You have 2n characters on a square grid. The characters consist of n different alphabets such that there are exactly each alphabet is occurs exactly 2 times. The characters are placed at the coordinates (1,0), (2,0), ..., (2n, 0). Your task is to draw a path for each pair of same alphabet. Each path should be composed of vertical or horizontal line segments between grid points. No two paths can intersect or touch each other. No path may cross the y=0 line. Each path can only touch the y=0 line at the position of the two characters it is connecting, so the first and last line segment of each path must be vertical. Given an arrangement of characters, give the minimum height of a solution, or indicate if no solution exists. The height is defined as the difference between the highest and lowest Y-coordinates of the paths used.
Example :
_ ___
| | | | a a b c b c |___| The minimum height is 2 in this case. You will be given a grid as input and you need to output whether a solution exists and if so, what is it? 5 points for correctness, and a further 5 points for efficiency given by the following formula: E=5/(1+t), t is the number of simulation clock cycles taken to produce the output in the worst case. The code must be written using only structural modelling except for the stimulus block or an initial block that reads the grid of characters at the beginning of the simulation. In other words it should be a parallel hardware implementation and not a software solution. Problem 2
Two arbitrarily long numbers (both numbers have the same number of digits) come in as a stream of digits, one after the other MSB first, LSB after an arbitrarily long time. You have to add them and display them on the screen as soon as possible. Your processor has finite storage space so you cant buffer them or something. Design and implement a solution in Verilog that takes as inputs two streams and does the above task. You can assume that every digit of each of the streams gets latched in to a register on every clock cycle. We are looking to optimize two metrics:
5 points for correctness, and a further 5 points for efficiency given by the following formula: E=5/(1+(t+s)/5), t is the number of simulation clock cycles taken to produce the output in the worst case, s is the storage space used in bytes. The code must be written using only structural or behavioural modelling. Problem 3
Design a system to implement Lempel-Ziv Compression Algorithm. Here you are supposed to generate a dictionary on the fly and output the compressed text. The decoder should only take the compressed text and output the decompressed text without any explicit dictionary supplied to it. You have to read the input from a file which will be a sequence of characters and write the output to another file. Design two modules, one each for compression and decompression. 10 points for correctness, and a further 10 points for efficiency given by the following formula: E=10/(1+1/r), r is the compression ratio (ie the ratio of output file size to input file size for the compression engine). The code must be written using only structural or behavioural modelling. Problem 4
Design a system to implement the Hough Transform, a commonly used image processing algorithm (Wiki this) that is used to detect straight lines in an image. The Hough Transform works by converting an image into another alternative representation where each straight line shows up as a peak in the parameter domain of straight lines ie the (m,c) space or the (rho,theta) space of the image. You will be given a 2-D image matrix as input, and an intensity threshold, and you must produce another 2-D matrix in the new parameter space as output. The peaks ie the (m,c) locations in the new image correspond to the parameters of the straight lines in the original image. The program will be judged on the correctness first and then the efficiency. 15 points for correctness, and a further 15 points for efficiency given by the following formula: E=15/(1+t), t is the number of simulation clock cycles taken to produce the output in the worst case. The code must be written using only structural modelling except for the stimulus block or an initial block that reads the matrix of the image at the beginning of the simulation. In other words it should be a parallel hardware implementation and not a software solution. Problem 5
Consider a system that does the following: You are given a Verilog description of a circuit in the form of a gate level netlist written in a given representation say A. You need to design a 'system' S that takes this representation of the gate level net list called A above, understands what circuit it represents, and generates a test bench to verify this circuit's functionality. The generated test bench code must be Verilog code that can be subsequently compiled and either synthesised or executed on the Verilog Discrete Event Simulator. The challenge is to write this system S itself in Verilog so that, in effect you are creating some sort of a meta tester IC that takes as input the gate level description of the circuit for which the test bench is to be generated. It outputs another gate level net list that can serve as a test bench for the original circuit. The program will be judged on the correctness first, and then the efficiency. 20 points for correctness, and a further 20 points for efficiency given by the following formula: E=20/(1+t), t is the number of simulation clock cycles taken to produce the output in the worst case. The code must be written using only structural modelling except for the stimulus block or an initial block that reads the netlist representation at the beginning of the simulation. In other words it should be a parallel hardware implementation and not a software solution. The gate level netlist of the circuit will be given in the form of standard Verilog structural code ie:
module «xyz» The output produced by the system S or the meta tester IC or the Verilog code for the system C, all of which are merely different representations of the same abstraction must be a test system that exhaustively tests the given circuit and which does so in the shortest time. The bound on the maximum number of variables in the boolean gate level net list is 8. And the time t mentioned above is the worst case number of clock cycles over the different instances of representation A that we use as sample inputs. So, the system S must first read the input, then parse it and determine the circuit in its own internal form, and subsequently generate a test bench Verilog circuit that tests the original circuit given as input, in an exhaustive manner. You are basically writing a hardware compiler. FAQ
Prize Money
Contact
In case of any queries, please contact: |
Hint for level 11 of Kryptic up!