forkconfig
Member level 1
- Joined
- Jan 28, 2013
- Messages
- 32
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,655
I'm trying to wrap my head around when to use tasks, functions, and modules.
In programming languages, I know how to break things up into objects/functions/structs etc, but translating that into hardware is difficult.
I'd appreciate some theory to help me understand.
Also, I have a specific question about a project I'm working on.
I'm trying to make an elevator, just a project I set up for myself to learn, but I am having troubles deciding how to break a specific portion of my code up.
I would appreciate input...
So in the section of the code that is analyzing requests and placing those requests into the correct location within the queue, there is quite a bit of code. I have to address internal requests (meaning requests from inside the elevator) separately from external requests (perhaps from a lobby) and my code is getting messy. I know that modularizing my code is good for verification purposes and readability, however if I do modularize this portion of my code then I have to have interfaces from the queues to both modules. However, I feel like this is making my design worse because of all the added interfaces and thus noise and cross talk I have to worry about. I see 4 options:
1) Just use tasks to improve code readability and loose benefits of modular design
2) Modularize it, the added interfaces are okay (in this case please explain why so I can identify for myself next time)
3) Modularize it, but also put the Queue's in there own module with an arbiter (I don't like this because now I have an arbiter!)
4) Insert a flux capacitor into the system and let R2-D2 do the coding...I thought there was a fourth but I couldn't remember so I made this up
Thanks in advance everyone
In programming languages, I know how to break things up into objects/functions/structs etc, but translating that into hardware is difficult.
I'd appreciate some theory to help me understand.
Also, I have a specific question about a project I'm working on.
I'm trying to make an elevator, just a project I set up for myself to learn, but I am having troubles deciding how to break a specific portion of my code up.
I would appreciate input...
So in the section of the code that is analyzing requests and placing those requests into the correct location within the queue, there is quite a bit of code. I have to address internal requests (meaning requests from inside the elevator) separately from external requests (perhaps from a lobby) and my code is getting messy. I know that modularizing my code is good for verification purposes and readability, however if I do modularize this portion of my code then I have to have interfaces from the queues to both modules. However, I feel like this is making my design worse because of all the added interfaces and thus noise and cross talk I have to worry about. I see 4 options:
1) Just use tasks to improve code readability and loose benefits of modular design
2) Modularize it, the added interfaces are okay (in this case please explain why so I can identify for myself next time)
3) Modularize it, but also put the Queue's in there own module with an arbiter (I don't like this because now I have an arbiter!)
4) Insert a flux capacitor into the system and let R2-D2 do the coding...I thought there was a fourth but I couldn't remember so I made this up
Thanks in advance everyone