Zoom into the lower-left hand corner of the design and enter the appropriate information into the information box.
To add Clay components to your design, access the ADD->Comp menu and select the (climacro) library in the bottom half of the window. The top half of the window contains a list of all available Clay macros for use in your design. Scroll through the list to become familiar with the symbols available to you. A text list of all Clay macros with their functional description is located here. The (cliprim) library listed underneath the (climacro) library is used for netlist conversion routines and should not be used for Clay designs.
Select the component fdmux.1 and place it on your schematic sheet. Add the components inv.1 and mux.1 to your schematic and interconnect the components as seen here. Add the following labels to the nets: Q0, CLK, R, SELA, SELB and D0 as seen here. It is also important to label each of the components on the schematic to help with the manual placement phases of design. Label the inverter inv0, the mux mux0, and the flip-flop ff0 as seen here. The low-order bit of the counter is now complete.
The counter operates according to the control signals sela and selb as follows:
For the second counter bit, add the components fdmux.1, inv.1, mux.1, and xond.1 to the schematic. Interconnect and label them as seen here. Create bits three and four of the counter as seen here. The counter is now complete complete and ready for simulation. Make sure the design is saved and checked.
Enter the following ViewSim commands to start the simulation:
Releasing the parallel load and cycling will increment the counter.
Enter the Interact tool by selecting the option Layout->Interact->Interact with Defaults (-g) from the ct design window. The interactive editor should appear. Note: Interact will sometimes behave unpredictably if other X applications steal too many colors from the display. You may have to close other applications.
Interact operates in one of three distinct modes:
To get a greater feel of the interact tool, try some of the following commands:
Execute the command Design->Place Instance to obtain the place component menu. Select the first component in the menu, FF0, with the mouse and select OK menu button. Note: Do not hit the CANCEL button - a bug in interact will cause interact to crash or act unpredictably. A yellow dotted square will appear on one of the interact cells indicating the position of the component. To place the component on a different cell, point the mouse to a vacant cell and click the left mouse button. The yellow square should have moved to the new location. When you have chosen an appropriate position for the component, press the middle mouse button to secure the location of the component.
Select the component by holding down the right mouse button and dragging the mouse across the component. Selection is indicated by a solid yellow square. Move the component by selecting the Edit->Move Selection menu. Select a different location of the component by clicking the left mouse button over a vacant cell. Zoom Full with F10. You will see the FF0 component as a small dot on the full view. Zoom Detail anywhere on the FPGA.
The three colored labels on the left of the FF0 cell indicate the three inputs to the cell. The cell has three inputs: red, green and blue and one output: red. The schematic symbol inside the cell indicates that the function is a MUX followed by a flip-flop. Using the same command to place the component, FF0, place the component INV0 directly underneath FF0. Now place the component MUX0 directly to the left of INV0 as seen here. The purple lines connecting the three components is the "rats nest" that indicates the connectivity of the three modules.
Because the output of the inverter, INV0, is on the blue output, it is unable to connect to the red input of the multiplexer, MUX0. In addition, since the output of the flip-flop, FF0, is red and enters the green input of INV0, it is not routable. The design could be routed if the modules are spread apart or if the port colors change. Change the port locations of the inverter by placing the mouse over the inverter and pressing the middle mouse four times. Notice that the colored ports change with each mouse click. The rats nest indicates that the two connections are routable.
Move the mouse over the purple wire connecting the inverter to the multiplexer. A rectangular yellow box should surround the purple wire. The yellow box indicates that a route is possible. Click the middle mouse button to complete the route. Follow the same instructions to route the flip-flop to the inverter. The two nets should be routed.
The purple line in the middle of the flip-flop indicates that the output of the flip-flop is connected to one of the inputs. Connect this feedback signal by routing through the block to the right of the flip-flop. Begin routing the net from the multiplexer to the flip-flop by connecting the red output to the cell on top of the multiplexer. To complete the route from the multiplexer to the flip-flop, place the mouse over the cell above the multiplexer and click the middle mouse. This causes the cell to perform a cross-over function (red-in goes to blue-out). Now complete the route to the flip-flop on the blue line.
Build the second bit of the counter as seen here. Complete the design by placing and routing all components associated with bits three and four as seen here. The design is placed and routed. Note: This design is not an optimal implementation of a parallel loadable counter in Clay. A more optimal approach will be provided as the tutorial progresses.
Please send comments to:
grahamp@salt.ee.byu.edu