In this week I had to continue working in creating Verilog top level module . As I mentioned in my last blog entry, the top level module should contain modules such as: processor, switch and several IOs devices. The instantiation of these modules was completed successfully in last weeks. In this week my work was mainly dedicated to the switch module. The switch is a module that is used -as widely known- to select one IO device to be connected to communicate with the processor. When we came to create or instantiate the switch in the top level module we have two routes to take:
1- to create one big switch based on the number of IOs declared in the user code
2- to use small switches and get them cascading based also on the number of IOs declared.
In this week I was working in developing an algorithm for the latest route.The smallest switch block we agreed upon was 1 to 4 (1 slave and 4 wishbone master interfaces). The program will first determine the number of (1 to 4 ) switches needed. Then the instantiation of switches and the connections will be followed accordingly. For example if the number of IO devices is 6, the number of switches needed would be 2 switch0 and switch1.Switch zero slave will be always connected to the processor and the first switch0 master interface would be reserved to the switch1 and the rest can be connected to the IOs devices and so on.
This algorithms worked but there were some problems that need to be addressed just like the addresses of the IOs devices issue. One problem was raised by Dr Shawn regarding this route was the length of the wires . He mentioned that as the number of Ios increases the length of the wire (that used to connect the processor with IO ) will increase as well which could lead the system to be slow. Apparently the algorithms I follow tends to have long wires connection which is not practically efficient. Dr.Shawn finally suggested to me to go and use the look up table to solve this matter. So for the next week I’ll be working on that. Hopefully next week will be more productive than this week.