Constructing a functional connectome and its computational model is a crucial step toward understanding the mechanisms of brain functions. To achieve this goal, we developed two correlated technologies: (1) An all-optical physiology (AOP) that is capable of millisecond volumetric imaging and accurate stimulation in living animal brains. This system allows us to establish functional connectome and neural coding with a single-cell resolution. (2) A cellular-level spiking neural circuit simulation system that is capable of tuning itself based on the input data from the AOP system. We have demonstrated our technologies in the Drosophila late visual system and will apply them in the brains of larger species such as mice. Our technologies will greatly enhance knowledge of brain operation.