Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/18/07 21:21
Read: times


 
#131061 - re: regarding write and read ops
Responding to: ???'s previous message
Suresh R said:
i am unable to perform the write operations without using mode "inout" for at least one bus.
could you give me an example of how it could be done.

and also for the code below which you gave for read operations..
kindly tell me in which mode 'dio' would be declared. if in 'out' mode,then how it could be connected to the data i/o pins of 8254.


I think it's time you bought a book about Verilog. Palnitkar's is pretty good.

Anyways: dio is declared in the module definition as inout. dio are the chip's data I/O pins.
assign oe = (!RD_l && !CS_l);
assign dio = oe ? diomux : 8'bZZZZ_ZZZZ;

always @(*) begin : diomuxselect
    case ({A, ctrlword})
        CASE0 : diomux = ...;
        CASE1 : diomux = ...;
         ...
        CASEN : diomux = ...'
    endcase
end // diomuxselect
Note that the ONLY assignment TO dio is given above.

Again: when writing into the chip's various registers, the data source is always dio:
always @(posedge WR_l) begin : writeareg
    if (!CS_l && RD_L && (address compare here) ) begin
        reg <= dio;
    end
end // writeareg

And, again, when to read from the chip, make sure that the decoder diomuxselect above has a case for each register, where the register assigns to diomux. It's really not that complicated...

-a

List of 28 messages in thread
TopicAuthorDate
data flow modeling in Verilog            01/01/70 00:00      
   How to post code            01/01/70 00:00      
   proper code...            01/01/70 00:00      
      Break up your code into smaller pieces            01/01/70 00:00      
         Thanks            01/01/70 00:00      
         what does that have to do with verilog? :)            01/01/70 00:00      
      Verilog bites like C            01/01/70 00:00      
         yes sorry. i made a mistake there.            01/01/70 00:00      
      ugh            01/01/70 00:00      
         details            01/01/70 00:00      
            dont use a bidirectional bus            01/01/70 00:00      
               regarding using seperate buses..            01/01/70 00:00      
                  out signal to status register            01/01/70 00:00      
                     hints            01/01/70 00:00      
                        Absolutely.            01/01/70 00:00      
                        Since \'diomux\' is a register....            01/01/70 00:00      
                           re: Since 'diomux' is a register ...            01/01/70 00:00      
                              regarding write and read operations...            01/01/70 00:00      
                                 re: regarding write and read ops            01/01/70 00:00      
                                    thank you..            01/01/70 00:00      
   Yukky verilog            01/01/70 00:00      
      Yes i did            01/01/70 00:00      
   all you do is...            01/01/70 00:00      
       can i do like this.,            01/01/70 00:00      
         if it's in BUFFER mode ...            01/01/70 00:00      
            buffer mode ports from the vhdl faq            01/01/70 00:00      
         mode out on RHS            01/01/70 00:00      
            very good Solutions!            01/01/70 00:00      

Back to Subject List