Chris_C

Members
  • Content count

    73
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Chris_C

  • Rank
    Advanced Member

Profile Information

  • Gender Not Telling
  1. JavaFX Logic toy

    While this isn't specifically fpga related I never the less think it a most cromulent way to play with logic networks... I'm considering making a none grid based more utiliterian logic simulator, now that I've proved that my state chage event system is suitable to simulate logic networks. While its really a toy I've been able to simulate adding 2, 4-bit values... You can read about it here http://chrisc.bedroomcoders.co.uk/logic-toy-a-logic-simulation-toy/ and grab the source here https://github.com/chriscamacho/LogicToy Enjoy !
  2. thanks magnus, I'll take a look at the fpgaprog sources...
  3. Looking at the code hamsters method does pad the bitfile and pload doesn't seem to have any options?
  4. Does this not mean I end up with a real massive file if I want something at say +2mb ? I'll have a look at pload though...
  5. Suppose I want my design to "load" data from the flash chip into sdram, at the moment I'd need a separate design to load data over serial (slow and painful even at 115200) save it temporarily in sdram and then write it into the flash If instead I could use the loader app with an offset I could upload the data to say +1mb in the flash at full USB speed AFAICT there is no parameter to specify where the data should start I suppose I could take my bit file pad it out at the end with zeros and add the data on the end but then thats going to make a very large file to upload...
  6. yes, condition codes it is! I don't think life without at *least* a carry flag would be much fun! I'm still trying to work out if I really need a stack, while it would make call/return and even parameters easier - I'm still investigating alternatives.
  7. Obviously condition codes are useful, but for some reason I was attempting to see if they were really needed... I've never seen the point of fixed(immediate) offsets ? I did intially attempt a fixed size of all instructions but kinda seemed to end up with lots of wasted space for a bunch of instructions I'm trying to weigh up if a single return address is sufficient or if I need to implement a call stack I'll PM you with my email, it may be that we can help each other by batting ideas back and forth!
  8. Nice spot! I missed that! Ahem its a typo I meant Ra = NOT Rb or possibly Ra = NOT Ra 8 spare? I need to look again when I get home ! Thanks great feedback!
  9. These are good points especially subroutines and returns (can't see how to fit it into the current set) I decided to restrict it to an 8 bit bus initially (there may be son and even granson of this cpu!) to reduce complexity and also to ensure it doesn't take up lots of room... While I can see the attraction of stack machines (from a hardware designers point of view) I've never particularly enjoyed programming them, this will be a machine I'll code in assembler and don't have a need for a C compiler That said they are all good points especially subroutines / return, thank you very much for your constructive points. hmmm NOP and SPARE - I did leave myself wiggle room for call / return.... (but this would need a call stack)
  10. I decided that no one could possibly require more than 16kb of data ! This allowed me to tidy up some of my addressing ideas and I made invalid index register use clearer 1 16bit PC4 8bit registers R0 to R38 bit data bus14 bit address bus (16kb)No condition codes1-3 byte instruction codes IIII RaRb NNNN NNNNCCAA AAAA AAAA AAAAinstruction bits (IIII)Value (NNNN NNNN)Address (AAA...) top 2 bits are condition code if needed (eq,ne,gt,lt)Ra Register R0 to R3Rb Register R0 to R3Rb16 value 0 or 2 representing 16bit register (0 = R0,R1) (2 = R2,R3)rbX invalid Rb16 value of 1if an invalid Rb16 value (RbX) of 1 is used then no 16 bit value is added tothe address (code 3 possible expansion ?)IIII Size Mnemonic Description0000 1 NOP spare ?0001 1 NAND Ra,Rb Ra=Ra NAND Rb0010 1 XOR Ra,Rb Ra=Ra XOR Rb0011 1 AND Ra,Rb Ra=Ra AND Rb0100 1 OR Ra,Rb Ra=Ra OR Rb0101 1 NOT Ra,Rb Ra=Ra NOT Rb0110 1 ADD Ra,Rb Ra=Ra AND Rb0111 1 SUB Ra,Rb Ra=Ra SUB Rb1000 1 SR Ra,Rb Ra shifted right Rb bits (only bottom 3 bits of Rb used)1001 1 SL Ra,Rb Ra shifted left Rb bits (only bottom 3 bits of Rb used)1010 1 HALT1011 2 SET Ra,NNNN Ra = immidiate 8bit value1100 3 PUT ( Rb16 + ADDRESS ) , Ra Ra is stored in address + Rb161101 3 GET Ra , ( Rb16 + ADDRESS ) Ra = contents of (address + Rb16)1110 3 JMPcc Ra,Rb, ADDRESS where cc (top 2 bit of address) = eq ne gt lt1111 3 JMP Rb16 + ADDRESS PC = address + Rb16Virtual instructions provided byPUT (ADDRESS),Ra PUT ( RbX + ADDRESS ), RaGET Ra, (ADDRESS) GET Ra, ( RbX + ADDRESS )JMP ADDRESS JMP rbX, ADDRESS
  11. Allthough finding ISE an uphill struggle! (but I am getting there) a long term goal is to design and implement my own CPU design. I'm looking to make something small and simple yet also powerful I'd really value peoples thoughts if only just to help get another perspective here's my rough design so far... 1 16bit PC4 8bit registers R0 to R3No condition codes1-3 byte instruction codes IIII RaRb NNNN NNNNCCAAAA AAAA AAAA AAAAinstruction bits (IIII)Value (NNNN NNNN)Address (AAA...) where CC is present AAA... is a signed 14bit offset (should address the bus only be 14bit 16kb probably enough?)Ra Register R0 to R3Rb Register R0 to R3Rb16 value 0 or 2 representing 16bit register (0 = R0,R1) (2 = R2,R3)if an invalid Rb16 value of 1 or 3 is used then no 16 bit value is added tothe address (code 3 possible expansion ?)IIII Size Mnemonic Description0000 1 NOP spare ?0001 1 NAND Ra,Rb Ra=Ra NAND Rb0010 1 XOR Ra,Rb Ra=Ra XOR Rb0011 1 AND Ra,Rb Ra=Ra AND Rb0100 1 OR Ra,Rb Ra=Ra OR Rb0101 1 NOT Ra,Rb Ra=Ra NOT Rb0110 1 ADD Ra,Rb Ra=Ra AND Rb0111 1 SUB Ra,Rb Ra=Ra SUB Rb1000 1 SR Ra,Rb Ra shifted right Rb bits (only bottom 3 bits of Rb used)1001 1 SL Ra,Rb Ra shifted left Rb bits (only bottom 3 bits of Rb used)1010 1 HALT1011 2 SET Ra,NNNN Ra = immidiate 8bit value1100 3 PUT ( Rb16 + ADDRESS ) = Ra Ra is stored in address + Rb161101 3 GET Ra = ( Rb16 + ADDRESS ) Ra = contents of (address + Rb16)1110 3 JMPcc Ra,Rb, PC+(A14-A0 signed) where cc (top 2 bit of address) = eq ne gt lt1111 3 JMP Rb16 + ADDRESS PC = address + Rb16Virtual instructionsJMP ADDRESS is actually JMPeq R0,R0, ADDRESS
  12. Rising_edge and falling_edge

    @johnbeetem logisim http://www.cburch.com/logisim/ is simple even does rudimentary propagation delay and is fantastic getting the pure logic right! You can bash together a logic circuit to test you logic is OK in probably less then 10% of the time you could using schematic capture / simulation and its a lot more user friendly! @hamster I'm missing the point as i fail to see how that's better than a counter ? (the pulses must be at least 6 clocks apart?) Perhaps you'd like to make a separate post so others don't miss it?
  13. Rising_edge and falling_edge

    My code as it stands now is working! I wanted to get a better understanding of rising / falling generally Add and end process and three endifs and throw something inside the ifs so they don't get optimised out and that should reproduce the error If you are particularly interested I could try to reintroduce the error into some fresh code One thing I find tiresome about the tools. (One of many things alas) is the fact it would simulate just fine, but not synthesise - what's the point of a simulation that doesn't actually simulate the limitations of the target device !
  14. Rising_edge and falling_edge

    Unfortunately I rewrote the code to work round it but in one process DoPulse process(clk,pulsein) If rising_edge(clk) ... If falling_edge(clk) ... If falling_edge(pulsein) I can see why it would complain about falling clk but after its removal it complained about falling pulse in Is it possible to drive 2 buffers from say clk and detect rising on the output of one buffer and falling on the other ?
  15. Allthough I could simulate some code which conditionally checked rising and falling edge, when it synthisised it spewed yet another cyptic error message statement is not synthesizable since it does not hold its value under NOT(clock-edge) I really need an error message to english translator! So I changed my logic about for the input it was complaining about and eliminated the falling edge check then it complained about the same thing but for a different input should I be using different processes for rising and falling edge, but then whats the best way to "communicate" between processes for example I can't really see how hardware could drive the same signal from two places? Assuming my logic really could only be done by detecting rising AND falling edge whats the best way to go about it... (incidently by changing my logic round I have a working module but I'm interested to learn about this for future pain with ISE)